tree-wide: set FORK_RLIMIT_NOFILE_SAFE flag

No functional changes, just refactoring.
This commit is contained in:
Yu Watanabe
2023-02-07 14:39:49 +09:00
parent e955a7f460
commit f3f2d02e97
7 changed files with 8 additions and 29 deletions
+1 -4
View File
@@ -22,7 +22,6 @@
#include "memory-util.h"
#include "path-util.h"
#include "process-util.h"
#include "rlimit-util.h"
#include "signal-util.h"
#include "stdio-util.h"
#include "string-util.h"
@@ -995,7 +994,7 @@ int bus_socket_exec(sd_bus *b) {
if (r < 0)
return -errno;
r = safe_fork_full("(sd-busexec)", s+1, 1, FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS, &b->busexec_pid);
r = safe_fork_full("(sd-busexec)", s+1, 1, FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_RLIMIT_NOFILE_SAFE, &b->busexec_pid);
if (r < 0) {
safe_close_pair(s);
return r;
@@ -1008,8 +1007,6 @@ int bus_socket_exec(sd_bus *b) {
if (r < 0)
_exit(EXIT_FAILURE);
(void) rlimit_nofile_safe();
if (b->exec_argv)
execvp(b->exec_path, b->exec_argv);
else