From owner-freebsd-questions Wed Nov 5 12:04:05 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id MAA03631 for questions-outgoing; Wed, 5 Nov 1997 12:04:05 -0800 (PST) (envelope-from owner-freebsd-questions) Received: from dreamworld.demon.co.uk (dreamworld.demon.co.uk [194.222.129.235]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id MAA03537 for ; Wed, 5 Nov 1997 12:03:54 -0800 (PST) (envelope-from eddyd@dreamworld.demon.co.uk) Received: from localhost (eddyd@localhost) by dreamworld.demon.co.uk (8.8.5/8.8.5) with SMTP id UAA00232 for ; Wed, 5 Nov 1997 20:53:15 GMT Date: Wed, 5 Nov 1997 20:53:15 +0000 (GMT) From: Eddy Deegan To: Free BSD Questions mailing list Subject: Re: question In-Reply-To: <3460990c.152757135@smtp-gw01.ny.us.ibm.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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 > 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 > > > > > > > >