* [PATCH] Fix execvp failing on not-dir entries in PATH.
@ 2017-10-22 22:07 Przemyslaw Pawelczyk
0 siblings, 0 replies; only message in thread
From: Przemyslaw Pawelczyk @ 2017-10-22 22:07 UTC (permalink / raw)
To: musl
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.
---
I'm not subscribed to ML, so please CC me in case of replying.
src/process/execvp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/process/execvp.c b/src/process/execvp.c
index 3a8bbe83295a..480a85e9383e 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;
--
2.13.5
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-10-22 22:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-22 22:07 [PATCH] Fix execvp failing on not-dir entries in PATH Przemyslaw Pawelczyk
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).