path: root/src/process
diff options
authorPrzemyslaw Pawelczyk <>2017-10-23 00:07:42 +0200
committerRich Felker <>2018-02-21 11:54:59 -0500
commit8e0b38060d7a9916fc2b5de0dd7c166ef60be9c1 (patch)
treeac6004074ca1656ee2c140ea58a598bb0e4759ca /src/process
parent75cba9c67fde03421b96c1bcbaf666b4b348739d (diff)
fix execvp failing on not-dir entries in PATH.
It's better to make execvp continue PATH search on ENOTDIR rather than issuing an error. Bogus entries should not render rest of PATH invalid. Maintainer's note: POSIX seems to require the search to continue like this as part of XBD 8.3 Other Environment Variables. Only errors that conclusively determine non-existence are candidates for continuing; otherwise for consistency we have to report the error.
Diffstat (limited to 'src/process')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/process/execvp.c b/src/process/execvp.c
index 3a8bbe83..480a85e9 100644
--- a/src/process/execvp.c
+++ b/src/process/execvp.c
@@ -40,7 +40,7 @@ int __execvpe(const char *file, char *const argv[], char *const envp[])
memcpy(b+(z-p)+(z>p), file, k+1);
execve(b, argv, envp);
if (errno == EACCES) seen_eacces = 1;
- else if (errno != ENOENT) return -1;
+ else if (errno != ENOENT && errno != ENOTDIR) return -1;
if (!*z++) break;
if (seen_eacces) errno = EACCES;