aboutsummaryrefslogtreecommitdiffstats
path: root/src/firejail/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/firejail/main.c')
-rw-r--r--src/firejail/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/firejail/main.c b/src/firejail/main.c
index c0050be1f..05745a3f1 100644
--- a/src/firejail/main.c
+++ b/src/firejail/main.c
@@ -95,6 +95,7 @@ int arg_quiet = 0; // no output for scripting
95int arg_join_network = 0; // join only the network namespace 95int arg_join_network = 0; // join only the network namespace
96int arg_join_filesystem = 0; // join only the mount namespace 96int arg_join_filesystem = 0; // join only the mount namespace
97int arg_nice = 0; // nice value configured 97int arg_nice = 0; // nice value configured
98int arg_ipc = 0; // enable ipc namespace
98 99
99int parent_to_child_fds[2]; 100int parent_to_child_fds[2];
100int child_to_parent_fds[2]; 101int child_to_parent_fds[2];
@@ -551,7 +552,6 @@ int main(int argc, char **argv) {
551 int i; 552 int i;
552 int prog_index = -1; // index in argv where the program command starts 553 int prog_index = -1; // index in argv where the program command starts
553 int lockfd = -1; 554 int lockfd = -1;
554 int arg_ipc = 0;
555 int arg_cgroup = 0; 555 int arg_cgroup = 0;
556 int custom_profile = 0; // custom profile loaded 556 int custom_profile = 0; // custom profile loaded
557 char *custom_profile_dir = NULL; // custom profile directory 557 char *custom_profile_dir = NULL; // custom profile directory
@@ -1619,8 +1619,11 @@ int main(int argc, char **argv) {
1619 1619
1620 // in root mode also enable CLONE_NEWIPC 1620 // in root mode also enable CLONE_NEWIPC
1621 // in user mode CLONE_NEWIPC will break MIT Shared Memory Extension (MIT-SHM) 1621 // in user mode CLONE_NEWIPC will break MIT Shared Memory Extension (MIT-SHM)
1622 if (getuid() == 0 || arg_ipc) 1622 if (getuid() == 0 || arg_ipc) {
1623 flags |= CLONE_NEWIPC; 1623 flags |= CLONE_NEWIPC;
1624 if (arg_debug)
1625 printf("Enabling IPC namespace\n");
1626 }
1624 1627
1625 if (any_bridge_configured() || any_interface_configured() || arg_nonetwork) { 1628 if (any_bridge_configured() || any_interface_configured() || arg_nonetwork) {
1626 flags |= CLONE_NEWNET; 1629 flags |= CLONE_NEWNET;