in reply to Re: cgi/perl/fortran web program
in thread cgi/perl/fortran web program
Hi sverrill,
This is clearly a workaround.
Not necessarily. Since it sounds like you're writing these scripts for a single server, and you are in control of in which paths the binaries are located on this server, then I think removing the dependence on the PATH environment variable by using absolute paths is an acceptable solution. Not only that, there have been security holes in which the PATH was manipulated, causing malicious programs to be executed instead of the real ones (which is one of the reasons that Perl's taint mode requires you to set your own $ENV{PATH}). Of course you don't need to hard-code the binaries' paths into every CGI script, you could for example use a configuration file at a known location.
Ensuring that PATH is set to a known value is also a solution of course, I just wanted to point out that despite all the teachings that hard-coding values is bad, absolute pathnames can still be useful :-)
Regards,
-- Hauke D
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: cgi/perl/fortran web program
by hippo (Archbishop) on Dec 15, 2016 at 09:49 UTC |