diff options
Diffstat (limited to 'src/firejail/sandbox.c')
-rw-r--r-- | src/firejail/sandbox.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/firejail/sandbox.c b/src/firejail/sandbox.c index 472f09355..568549cbf 100644 --- a/src/firejail/sandbox.c +++ b/src/firejail/sandbox.c | |||
@@ -664,10 +664,15 @@ int sandbox(void* sandbox_arg) { | |||
664 | if (rv) | 664 | if (rv) |
665 | exit(rv); | 665 | exit(rv); |
666 | } | 666 | } |
667 | if (arg_seccomp && (cfg.seccomp_list || cfg.seccomp_list_drop || cfg.seccomp_list_keep)) | ||
668 | arg_seccomp_postexec = 1; | ||
667 | #endif | 669 | #endif |
668 | 670 | ||
671 | // need ld.so.preload if tracing or seccomp with any non-default lists | ||
672 | bool need_preload = arg_trace || arg_tracelog || arg_seccomp_postexec; | ||
673 | |||
669 | // trace pre-install | 674 | // trace pre-install |
670 | if (arg_trace || arg_tracelog) | 675 | if (need_preload) |
671 | fs_trace_preload(); | 676 | fs_trace_preload(); |
672 | 677 | ||
673 | // store hosts file | 678 | // store hosts file |
@@ -704,7 +709,7 @@ int sandbox(void* sandbox_arg) { | |||
704 | //**************************** | 709 | //**************************** |
705 | // trace pre-install, this time inside chroot | 710 | // trace pre-install, this time inside chroot |
706 | //**************************** | 711 | //**************************** |
707 | if (arg_trace || arg_tracelog) | 712 | if (need_preload) |
708 | fs_trace_preload(); | 713 | fs_trace_preload(); |
709 | } | 714 | } |
710 | else | 715 | else |
@@ -767,7 +772,7 @@ int sandbox(void* sandbox_arg) { | |||
767 | else { | 772 | else { |
768 | fs_private_dir_list("/etc", RUN_ETC_DIR, cfg.etc_private_keep); | 773 | fs_private_dir_list("/etc", RUN_ETC_DIR, cfg.etc_private_keep); |
769 | // create /etc/ld.so.preload file again | 774 | // create /etc/ld.so.preload file again |
770 | if (arg_trace || arg_tracelog) | 775 | if (need_preload) |
771 | fs_trace_preload(); | 776 | fs_trace_preload(); |
772 | } | 777 | } |
773 | } | 778 | } |
@@ -903,7 +908,7 @@ int sandbox(void* sandbox_arg) { | |||
903 | //**************************** | 908 | //**************************** |
904 | // install trace | 909 | // install trace |
905 | //**************************** | 910 | //**************************** |
906 | if (arg_trace || arg_tracelog) | 911 | if (need_preload) |
907 | fs_trace(); | 912 | fs_trace(); |
908 | 913 | ||
909 | //**************************** | 914 | //**************************** |