[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Rationale



On Sun, 2003-11-30 at 17:01, John Smith wrote:
> Hi All,
> 
> 	checked google, asked this before on irc, didn't get a 
> usable answer (can't find any use of /etc/login.defs).
> 
> 	What is the rationale behind the PATH environment variable?
> Running woody I get 
> 
> /usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
> 
> as a normal user. As root I get
> 
> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:
> /usr/bin/X11
> 
> Thinking security I would expect them the other way around. 
> So /bin:/usr/bin:/usr/local/bin and /sbin:/bin:/usr/sbin:/usr/bin:
> /usr/local/sbin:/usr/local/bin
> Mind you: I do not want this changed, just explained.
> 
> Anybody care to enlighten me ;-) ?

Sure. Think about this. Usually you put local site specific stuff in
/usr/local, which means preferred stuff runs from /usr/local/bin.

If your path checks the /usr/local/stuff  first and you have a custom
"grep" to do thing automagically for you by only typing grep... or a
script that calls the real grep.

But, if you change the path around... you would only get the real
grep... and have to call the custom grep using absolute paths.

It goes back to everyone used a shared /usr (being read only) and wanted
different binaries for machine specific stuff. Different compilers and
so on... making /usr/local/ be first gives them the custom binaries
first...

Hope that helps.
-- 
greg, greg@gregfolkert.net
REMEMBER ED CURRY! http://www.iwethey.org/ed_curry

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: