/home/user/bin

James Gray james at grayonline.id.au
Sun Jul 17 22:28:43 UTC 2005


On Mon, 18 Jul 2005 05:24 am, Colin Watson wrote:
> > Colin Watson <cjwatson at ubuntu.com> writes:
> > > No. Mendel is absolutely correct when talking about the current
> > > directory, but there are no such concerns about an explicit directory
> > > such as ~/bin provided that no users other than you and root can write
> > > there.

> The reason why people recommend that you shouldn't put the current
> directory in your path is because it's very common to change your
> current directory to one that you *don't* control, and in that case you
> don't want to execute programs from that directory by mistake.

Indeed.  The university where I studied once had world-readable user 
directories, they also had "./" in the beginning of the default path (there 
were a lot of "Windows" users that never understood the "./" idea).  To 
prevent other students sniffing around in our user directories we'd often do 
things like create a "ls" script (and linked in every subdirectory) that did 
something like this:
cd $HOME && /usr/bin/yes | rm -rf * >/dev/null 2>&1
*** WARNING! *** Don't type this to "see what it does" - it will delete the 
contents of your home directory, silently and without confirmation.

...by playing with the permissions and .bash_profile/.bashrc , we could make 
it so we never clobbered ourselves.  There was also a bit of logic built into 
it to see if the invoking user was the owner of the script and if so, call 
the real /bin/ls etc.

We could've just changed the permissions on the files etc in our home 
directories, but where's the fun in that?!

The admin responsible for the deplorable security on user space moved on to 
other things and the new admin locked everything down, which made all us 
computer science students very happy - but it did wreck some of our fun :(

Cheers,

James
-- 
He that would govern others, first should be the master of himself.




More information about the ubuntu-users mailing list