From 09a83db55bf54f6afbde166f7edbe6bc68b90b67 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Mon, 12 Apr 2021 17:50:39 +0200 Subject: [PATCH] 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 --- src/lxc/rexec.c | 3 --- 1 file changed, 3 deletions(-) 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); } -- 2.47.2