[Bug 259625] fexecve interacts incorrectly with interpreters

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 03 Nov 2021 10:46:25 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259625

--- Comment #4 from Drew DeVault <sir@cmpwn.com> ---
This also fails:

#include <assert.h>
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
#include <unistd.h>

int main(void) {
        int fd = open("./test.sh", O_EXEC | O_RDONLY);
        char buf[PATH_MAX];
        sprintf(buf, "/dev/fd/%d", fd);
        int fd2 = open(buf, O_RDONLY | O_CLOEXEC);
        assert(fd2 >= 0);
}

So perhaps this is not related to fexecve.

-- 
You are receiving this mail because:
You are the assignee for the bug.