summaryrefslogtreecommitdiffstats
path: root/src/firejail/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/firejail/main.c')
-rw-r--r--src/firejail/main.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/firejail/main.c b/src/firejail/main.c
index a9ccfc9cc..3a06ec0f1 100644
--- a/src/firejail/main.c
+++ b/src/firejail/main.c
@@ -425,10 +425,21 @@ int main(int argc, char **argv) {
425 // check if we already have a sandbox running 425 // check if we already have a sandbox running
426 int rv = check_kernel_procs(); 426 int rv = check_kernel_procs();
427 if (rv == 0) { 427 if (rv == 0) {
428 // start the program directly without sandboxing 428 // if --force option is passed to the program, disregard the existing sandbox
429 run_no_sandbox(argc, argv); 429 int found = 0;
430 // it will never get here! 430 for (i = 1; i < argc; i++) {
431 assert(0); 431 if (strcmp(argv[i], "--force") == 0) {
432 found = 1;
433 break;
434 }
435 }
436
437 if (found == 0) {
438 // start the program directly without sandboxing
439 run_no_sandbox(argc, argv);
440 // it will never get here!
441 assert(0);
442 }
432 } 443 }
433 444
434 // initialize globals 445 // initialize globals
@@ -478,6 +489,8 @@ int main(int argc, char **argv) {
478 arg_debug_whitelists = 1; 489 arg_debug_whitelists = 1;
479 else if (strcmp(argv[i], "--quiet") == 0) 490 else if (strcmp(argv[i], "--quiet") == 0)
480 arg_quiet = 1; 491 arg_quiet = 1;
492 else if (strcmp(argv[i], "--force") == 0)
493 ;
481 494
482 //************************************* 495 //*************************************
483 // filtering 496 // filtering