My answer is: it depends on the setup, and what you do with the directory afterwards. Judging from your previous post, I assume that is going to be your "list of valid subdirectories".
Are these directories predefined and created by you? If they are not (i.e. they can be created by users) then you should be careful with them, even if they pass your "validity" check. I think using -d is OK because it does not interpret any metacharacters AFAIK, but if you later use that name in something that does (like open or system), you will get in trouble if you don't sanitize the names before allowing them to pass.
If the valid directories can only be created by you, as long as you are careful with their names, I think you should be OK. In any case, it's best if you do something to untaint the data before using it in any possibly vulnerable commands.
--ZZamboni
In reply to Re: Possible Security Problem
by ZZamboni
in thread Possible Security Problem
by Stamp_Guy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |