The problem is that someone could change the path such that the unzip called is not the unzip you thought you were calling. It has nothing to do with unzip's arguments. (By the way, your "absolute paths" aren't absolute, but that doesn't matter.)
might do the trick, but why use multiple argument form when not needed. You're just asking for shell-interpolation trouble. Use the following instead:system "/usr/local/bin/unzip /home/mysite/zips/$zipfile -d /home/mysit +e/unzips";
and if that still complains,system "/usr/local/bin/unzip", "/home/mysite/zips/$zipfile", "-d", "/home/mysite/unzips";
will definitely do the trick. If you're not sure where unzip will be located, the following should work:{ local $ENV{'PATH'} = ''; system "/usr/local/bin/unzip", "/home/mysite/zips/$zipfile", "-d", "/home/mysite/unzips"; }
{ local $ENV{'PATH'} = '/usr/local/bin:/usr/bin'; system "unzip", "/home/mysite/zips/$zipfile", "-d", "/home/mysite/unzips"; }
In reply to Re: Insecure $ENV{PATH}
by ikegami
in thread Insecure $ENV{PATH}
by Andre_br
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |