PATH bug?

John Mashey mash at mips.UUCP
Wed Aug 7 17:50:38 AEST 1985


> > If the current directory is specified as the last directory searched using
> > a trailing ":" instead of ":." (in $PATH) then sh will not find executable
> > files in the current directory.
> > I have noticed this bug under Vr0 and Vr2.  Is this problem more widespread
> > than just my vendor?
>  ......
> Yes, it's even more widespread than you might think.  I suspect it's in
> every Bourne shell (except for the ones that've fixed it)....
> 
> The fix should be obvious (look in "service.c") - unless this is a feature,
> not a bug...

It is clearly a bug, not a feature, because it does not work like execvp(2),
which is supposed to be the canonical definition of what exec $PATH search is.
To verify this (from Bourne shell, with command in current directory):
PATH=:/bin time command (works)
PATH=/bin: time command (works)
PATH=/bin: command (not found)

This is clearly wrong; a long time ago, far away, we went to some pain to get
the identical path-search code into every command .... except /bin/sh. sigh.
-- 
-john mashey
UUCP: 	{decvax,ucbvax,ihnp4}!decwrl!mips!mash
DDD:  	415-960-1200
USPS: 	MIPS Computer Systems, 1330 Charleston Rd, Mtn View, CA 94043



More information about the Net.bugs.usg mailing list