I have a line in a script that looks like this:
opendir(DIR, $Path->{'real'});
This call returns false. The value of $Path->{'real'} is defined by a module that gets the value from a conf file. If I print out the value I get the following:
/usr/
This directory of course exists, so the following code returns true:
opendir(DIR, "/usr/");
Strangely, so does this code:
$Path->{'real'} = "/usr/"; opendir(DIR, $Path->{'real'});
This led me to think $Path->{'real'} was tainted and therefore not usable in the opendir call, however it still doesn't work if I untaint it like so:
$Path->{'real'} =~ /(.*)/; $Path->{'real'} = $1; opendir(DIR, $Path->{'real'});
This code is a functioning part of mozilla.org's installation of LXR running on a Solaris box with perl 5.004. I am trying to get it working on my own RedHat Linux 7.0 machine running 5.6.1. What could be going wrong here?
In reply to why would opendir fail? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |