From: Przemyslaw Pawelczyk <przemoc@gmail.com>
To: musl@lists.openwall.com
Subject: [PATCH] Fix execvp failing on not-dir entries in PATH.
Date: Mon, 23 Oct 2017 00:07:42 +0200 [thread overview]
Message-ID: <20171022220742.21966-1-przemoc@gmail.com> (raw)
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
reply other threads:[~2017-10-22 22:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171022220742.21966-1-przemoc@gmail.com \
--to=przemoc@gmail.com \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).