Is it safe to rely on the PATH environment variable to locate external programs?
Not really. One favorite hacker’s trick is to alter the PATH environment variable so that it points to the program he wants your script to execute rather than the program you’re expecting. In addition to avoiding passing unchecked user variables to external programs, you should also invoke the programs using their full absolute pathnames rather than relying on the PATH environment variable.
Not really. One favorite hacker’s trick is to alter the PATH environment variable so that it points to the program he wants your script to execute rather than the program you’re expecting. In addition to avoiding passing unchecked user variabes to external programs, you should also invoke the programs using their full absolute pathnames rather than relying on the PATH environment variable.