The PATH isn't the only environment variable which can cause problems. Because some shells may use the variables IFS, CDPATH, ENV, and BASH_ENV, Perl checks that those are either empty or untainted when starting subprocesses.
Likely your singular client is the only one whose shell is setting $ENV{ENV}.
As a secondary note, rather than stashing and restoring values, you can use local to create a lexically dynamically-scoped version of the variable, meaning you don't have to worry about forgetting to restore a value. So maybe you want to write:
and $ENV{PATH} will be restored once the sub exits. As it stands, the path is clobbered if your open fails, and this would fix that. Or if you want to be thoroughlocal $ENV{PATH} = '/bin:/usr/bin:/usr/local/bin';
local @ENV{qw|PATH IFS CDPATH ENV BASH_ENV|} = '/bin:/usr/bin:/usr/loc +al/bin';
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In reply to Re: Insecure Environment ?
by kennethk
in thread Insecure Environment ?
by PapaJohn454
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |