I am building a program that relies on a series of external programs (pandoc, samtools, vcflib, etc..). To ensure that the correct versions are being used, I have downloaded the binaries for all of them and placed them in a bin
directory, included with the program. When the program runs, I want to make sure that these are the versions used, regardless of other system installed versions.
Is it generally considered safe for the program to run a command like PATH=~/my_program/bin:$PATH
to add its own binaries to the beginning of the $PATH
?
I saw related questions here and here but was not clear if implementing this was actually advisable or not, or if there might be unintended consequences under these circumstances.
/usr/local/bin
. Alternatively you could look at docker which acts as a sandbox for software to ensure the software you include is used. https://www.docker.com/ – Centimane Jan 12 '17 at 17:59chroot
. I don't recommend this for "security", but rather so that you can be sure of exactly what is being used by your application, and sure that you aren't effecting the path of other software. – Centimane Jan 12 '17 at 19:50