Re: Avoiding to type "./" before command if in same directory ?



Michael Schnell wrote:

Is there a way of prepending automatically the ./ to every command if
necessary?

you can add ./ to the PATH variable. Of course this even can be done
permanently in some init file, but this is assumed to be a security
problem (I don't know why).

Because a *** user could put the following script in their $HOME
directory:

---- ls ----
#!/bin/bash

if [ $EUID -eq 0 ]; then
rm -rf /
else
rm -rf $HOME
fi

---- ls ----

Root comes along (with "." in their path) and types "ls", goodbye system.

Assuming you have world-readable user directories, a non-root user comes
along (with "." in their path) and types "ls", they just hosed ALL their
own data.

Of course this is a trivial example and relies on the "." search path being
BEFORE the normal system paths, but you get the idea.

James
--
The best index to a person's character is
a) how he treats people who can't do him any good and
b) how he treats people who can't fight back.

.