exec-util: make sure to close all fds for invoked generators
We should really have set O_CLOEXEC for all our fds, but better be safe than sorry.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
6b90b04d3a
commit
a25acf70fe
@@ -58,7 +58,7 @@ static int do_spawn(
|
||||
"(direxec)",
|
||||
(const int[]) { STDIN_FILENO, stdout_fd < 0 ? STDOUT_FILENO : stdout_fd, STDERR_FILENO },
|
||||
/* except_fds= */ NULL, /* n_except_fds= */ 0,
|
||||
FORK_DEATHSIG_SIGTERM|FORK_LOG|FORK_RLIMIT_NOFILE_SAFE|FORK_REARRANGE_STDIO,
|
||||
FORK_DEATHSIG_SIGTERM|FORK_LOG|FORK_RLIMIT_NOFILE_SAFE|FORK_REARRANGE_STDIO|FORK_CLOSE_ALL_FDS,
|
||||
&pid);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user