From: Christian Brauner Date: Mon, 12 Apr 2021 15:50:39 +0000 (+0200) Subject: Revert "rexec: mark all fds as close-on-exec if possible" X-Git-Tag: lxc-5.0.0~211^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3779%2Fhead;p=thirdparty%2Flxc.git Revert "rexec: mark all fds as close-on-exec if possible" 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 --- diff --git a/src/lxc/rexec.c b/src/lxc/rexec.c index 508d7eadc..060df680e 100644 --- a/src/lxc/rexec.c +++ b/src/lxc/rexec.c @@ -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); }