]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Revert "rexec: mark all fds as close-on-exec if possible" 3779/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 12 Apr 2021 15:50:39 +0000 (17:50 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 12 Apr 2021 15:50:39 +0000 (17:50 +0200)
This reverts commit 531d36ad009325b74a105d9d6956e320f37b2937.

Callers might want to explicilty inhert file descriptors so we can't
close them behind their back when we exec.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/rexec.c

index 508d7eadc44a206a0c14225e7fe0a895c91c16da..060df680e22b8f230014d8aaee6681ffd6653101 100644 (file)
@@ -162,9 +162,6 @@ static void lxc_rexec_as_memfd(char **argv, char **envp, const char *memfd_name)
        if (execfd < 0)
                return;
 
-       ret = close_range(STDERR_FILENO + 1, MAX_FILENO, CLOSE_RANGE_CLOEXEC);
-       if (ret && (errno != ENOSYS && errno != EINVAL))
-               fprintf(stderr, "%m - Failed to mark all file descriptors as close-on-exec\n");
        fexecve(execfd, argv, envp);
 }