You can also fool sh into running the *wrong* binary if if you have
two in showdowed paths:

#! /bin/sh

test -d foo1 || mkdir foo1
test -d foo2 || mkdir foo2
test -d foo2 || mkdir foo3
echo 'echo :one' > foo1/run
echo 'echo :two' > foo2/run
echo 'echo :three' > foo2/run3
chmod a+x */run*

hash -r
echo
echo Expect one:
PATH=./foo3:./foo1:./foo2:./foo5

echo Expect two:
PATH=./foo3:./foo3:./foo1 run
echo run should be in in foo1:
hash -v
echo $PATH
echo Should give one:
run

==> runs foo2/run, not foo1/run.

This is still covered by the quick fix I sent. Looking for cases that
aren't... 

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <[EMAIL PROTECTED]> http://www.cons.org/cracauer/
BSD User Group Hamburg, Germany     http://www.bsdhh.org/


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to