aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2021-05-16 17:14:05 +0200
committerLibravatar smitsohu <smitsohu@gmail.com>2021-05-16 17:15:21 +0200
commitff7877ed2e99abe08947ee16a589174e337640a7 (patch)
tree8c0debf8f1124b2932125402768f6c0424443b16
parentutmp follow-up (diff)
downloadfirejail-ff7877ed2e99abe08947ee16a589174e337640a7.tar.gz
firejail-ff7877ed2e99abe08947ee16a589174e337640a7.tar.zst
firejail-ff7877ed2e99abe08947ee16a589174e337640a7.zip
O_CLOEXEC follow-up
-rw-r--r--src/firejail/main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/firejail/main.c b/src/firejail/main.c
index cf14c077a..025442035 100644
--- a/src/firejail/main.c
+++ b/src/firejail/main.c
@@ -2874,12 +2874,6 @@ int main(int argc, char **argv, char **envp) {
2874 } 2874 }
2875 EUID_ASSERT(); 2875 EUID_ASSERT();
2876 2876
2877 // create the parent-child communication pipe
2878 if (pipe(parent_to_child_fds) < 0)
2879 errExit("pipe");
2880 if (pipe(child_to_parent_fds) < 0)
2881 errExit("pipe");
2882
2883 if (arg_noroot && arg_overlay) { 2877 if (arg_noroot && arg_overlay) {
2884 fwarning("--overlay and --noroot are mutually exclusive, noroot disabled\n"); 2878 fwarning("--overlay and --noroot are mutually exclusive, noroot disabled\n");
2885 arg_noroot = 0; 2879 arg_noroot = 0;
@@ -2921,6 +2915,12 @@ int main(int argc, char **argv, char **envp) {
2921 } 2915 }
2922#endif 2916#endif
2923 2917
2918 // create the parent-child communication pipe
2919 if (pipe2(parent_to_child_fds, O_CLOEXEC) < 0)
2920 errExit("pipe");
2921 if (pipe2(child_to_parent_fds, O_CLOEXEC) < 0)
2922 errExit("pipe");
2923
2924 // clone environment 2924 // clone environment
2925 int flags = CLONE_NEWNS | CLONE_NEWPID | CLONE_NEWUTS | SIGCHLD; 2925 int flags = CLONE_NEWNS | CLONE_NEWPID | CLONE_NEWUTS | SIGCHLD;
2926 2926