On Wednesday, Mar 30, 2005, at 14:45 US/Central, Jon Drews wrote:
On Wed, 30 Mar 2005 08:35:34 -0600, Rex Nelson <[EMAIL PROTECTED]> wrote:
I belive it would be a big security no-no to have it first or before
/bin if your account on the computer could be accessed by anyone
"untrusted" because any command could be modified for good or evil in
~/bin and it would be found before the "real" command in /bin (which
would take root access to modify).

Excellent Rex. That is a very good reason to put it at the end of the path.

After reading the responses and talking with a few people, I'm of the same opinion as Ed, that it probably doesn't matter where ~/bin is located in your PATH.


Historically, I've always put ~/bin first in my PATH because often I have commands that are named the same and I want to mask the system-wide commands with custom configurations of my own. For example, I have the command gcc in my ~/bin. The script has some logic in it to determine what architecture I'm on and sets the appropriate environment variables before calling the "real" gcc.

However, Ed has a good point regarding aliases. I could just as easily specify an alias, e.g. alias gcc=~/bin/gcc, and then it wouldn't matter where ~/bin appeared in my PATH. I could even specify the whole logic in the alias, e.g. alias gcc=( if ... ; gcc ) and not put ~/bin in my PATH at all. Of course, aliases take up memory in the shell, but only a few bytes or KBytes. With machines now having MB or GB of RAM, who cares about a few bytes.

As for security, if someone is putting or modifying executable code in your ~/bin, then I would not worry about where ~/bin appears in your PATH.

Regards,
- Robert
http://www.cwelug.org/downloads
Help others get OpenSource software.  Distribute FLOSS
for Windows, Linux, *BSD, and MacOS X with BitTorrent

_______________________________________________
CWE-LUG mailing list
http://www.cwelug.org/ [email protected]
http://lists.firepipe.net/listinfo/cwe-lug

Reply via email to