#323 closed defect (fixed)
spawnlp() does not check if an entry is a directory
Reported by: | KO Myung-Hun | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | libc-0.7 |
Component: | libc-frontend | Version: | 0.6.6 |
Severity: | trivial | Keywords: | _path _path2 _searchenv _searchenv2 _searchenv2_value |
Cc: |
Description
Hi/2.
If a directory whose name is same as [name] exist in a current dir or maybe in PATH, spawnlp() fails. spawnlp() and its families should check if [name] is a directory when searching the executable for [name].
Attachments (1)
Change History (3)
by , 10 years ago
comment:1 by , 10 years ago
Component: | libc → libc-frontend |
---|---|
Keywords: | _path _path2 _searchenv _searchenv2 _searchenv2_value added |
Resolution: | → fixed |
Severity: | normal → trivial |
Status: | new → closed |
No, won't happen if it's within EMXPATH or PATH, only for the current directory.
The _searchenv2 / _searchenv2_value would pass on EISDIR from the current directory iff the path variable (EMXPATH) wasn't set in the environment. This would stop _path2() from searching the PATH. Fixed in r3941 (both trunk + branch).
(Note! This is not new behavior, EMX always did this, even for matching directories within EMXPATH and PATH. kLibC 0.6.6 attempted to improve on this and this one problem slipped thru.)
comment:2 by , 10 years ago
emx(maybe and kLIBC older than 0.6.6) does not this behavior. However, this is because emx adds .exe to a file name not having an extension by default. If there is a directory whose name is [name].exe, emx will fail.
This problem have been hidden so far. Lucky.
testcase