[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Hashed excutable found is incorrect where 2 executables of samename in 2

From: Marc A Dickenson
Subject: Hashed excutable found is incorrect where 2 executables of samename in 2 dirs specified by PATH
Date: Tue, 11 Feb 2003 15:09:30 -0600

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
ux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' -DCONF_VENDOR='redhat'
/lib -I/usr/include -O2 -march=i386 -mcpu=i686
uname output: Linux fspbld04 2.4.7-10enterprise #1 SMP Thu Sep 6 16:48:20
EDT 2\
001 i686 unknown
Machine Type: i386-redhat-linux-gnu

Bash Version: 2.05
Patch Level: 8
Release Status: release


Hashing seems to pick the wrong executable when same executable name is in
more than one directory in PATH.


1) cat /tmp/texe
echo texe in TMP

2) cat /tmp/tmp1/texe
echo texe in TMP1

3) export PATH=$PATH:/tmp:/tmp/tmp1  <=== add test dirs to path

4) chmod 666 /tmp/texe; chmod 777 /tmp/tmp1/texe

5) which texe ==> shows /tmp/tmp1/texe, which is the correct one

6) texe ==> print “texe in TMP1” ==> this is correct

7) chmod 777 /tmp/texe ==> turn on exe bit for /tmp/exe

8) which texe ==> shows /tmp/texe ==> this is correct

>>>>>>>>>>>>>>>>> Note: If you run hash -r here, it works, if you dont 9

9) texe ==> print “texe in TMP1” ==> THIS IS NOT CORRECT. Why?????

10) hash ==> texe is hashed to /tmp/tmp1/texe ==> which is wrong.



If i run hash -r in the testcase below before the final problem where it
fails... then it works,  but I guess a user shouldnt be required to do

you could also type set +h  // turn off hashing...

reply via email to

[Prev in Thread] Current Thread [Next in Thread]