-
Bug
-
Resolution: Not a Bug
-
Normal
-
None
-
rhel-8.4.0
-
None
-
Moderate
-
rhel-sst-cs-plumbers
-
ssg_core_services
-
None
-
False
-
-
None
-
None
-
None
-
None
-
If docs needed, set a value
-
-
All
-
None
This bug was initially created as a copy of Bug #2010398
I am copying this bug because:
Sample reproducer:
<< rhel5 and any bash version go to $HOME or directory not in $PATH >>
$ cd
$ cat > a <<EOF
echo foo
EOF
$ source a
foo
<< rhel6 and newer with ksh after creating the file to be sourced >>
$ source a
ksh: .: a: cannot open [No such file or directory]
but bash works, and is documented to do so.
The code is basically identical from rhel5 to rhel7, major difference is:
https://github.com/ksh93/ksh/blame/master/src/cmd/ksh93/sh/path.c#L403
that is, newer ksh has:
if(pp->flags&PATH_SKIP)
return(ppnext);
and older ksh has:
if(pp->flags&PATH_SKIP)
continue;
there is nothing useful in git blame or changelog that I could see.
What was noticed is that on older ksh when traversing pp
(shp->pathlist), due to the 'do {} while' in path_opentype, it eventually
calls sh_open with just the file name, not a prefix, while on newer ksh, it
calls sh_open twice with the last component in the $PATH.
This makes ksh different from bash, and cause the source command to require
'.' in $PATH to be able to source files in the current directory.