This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] [BZ #18433] Check file access/existence before forking.
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: Navid Rahimi <rahimi dot nv at gmail dot com>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Thu, 10 Sep 2015 16:01:58 +0100
- Subject: Re: [PATCH] [BZ #18433] Check file access/existence before forking.
- Authentication-results: sourceware.org; auth=none
- References: <55F19819 dot 3010601 at gmail dot com>
On 10/09/15 15:47, Navid Rahimi wrote:
[BZ #18433]
* sysdeps/posix/spawni.c (__spawni):
Check file access before forking.
---
+++ b/sysdeps/posix/spawni.c
@@ -90,6 +90,9 @@ __spawni (pid_t *pid, const char *file,
size_t len;
size_t pathlen;
+ if(__access (file, X_OK) != 0)
+ return errno;
+
this does not guarantee the success of __execve (file, argv, envp).