Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Nov 1997 20:53:15 +0000 (GMT)
From:      Eddy Deegan <eddyd@dreamworld.demon.co.uk>
To:        Free BSD Questions mailing list <freebsd-questions@freebsd.org>
Subject:   Re: question
Message-ID:  <Pine.BSF.3.96.971105204830.211D-100000@dreamworld.demon.co.uk>
In-Reply-To: <3460990c.152757135@smtp-gw01.ny.us.ibm.net>

next in thread | previous in thread | raw e-mail | index | archive | help

Because if you are root, then you should *never* have the current
directory in your path. Suppose someone sticks a hard link called 'cp'
in your current directory which points to 'rm' ... OK, so this particular
example is unlikely, but unless you are VERY SURE you A) know what you are
doing, and B) no-one else uses your system (ie: it's a single-user
machine) you should be aware that the most obvious way to fall foul of
people who think it's funny to cause you grief is to provide them with a
mehcanism to trip you up.

And sticking the current dir in your path is just such a mechanism.

Ideally when running as root you should have no path whatsoever, although 
most people don't go quite that far.

Eddy Deegan

On Wed, 5 Nov 1997, John Kelly wrote:

> On Wed, 5 Nov 1997 08:31:20 +0000 (GMT), Eddy Deegan
> <eddyd@dreamworld.demon.co.uk> wrote:
> 
> >You can, but your path probably doesn't look in the current directory for
> >them. Type:
> >
> >% ./a.out
> >
> >instead of just plain vanilla 'a.out' and it will probably work.
> 
> One of my first changes after an install is PATH in .profile, where I
> add a colon to the front of the path so that my current directory is
> found in my path.
> 
> Why doesn't .profile have it that way by default?  It seems to me that
> you would want to look in the current directory first.
> 
> John
> 
> 
> 
> 
> 
> 
> 
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.971105204830.211D-100000>