Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Mon, 23 Oct 2017 00:07:42 +0200
From: Przemyslaw Pawelczyk <przemoc@...il.com>
To: musl@...ts.openwall.com
Subject: [PATCH] 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.
---

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.