From 0dc883bfcb1e4c2bfec41bef4f7a4001e6aa983d Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sun, 5 Apr 2020 09:57:34 -0400 Subject: compile cleanup --- src/firejail/main.c | 10 +++++++++- src/firejail/seccomp.c | 4 +--- src/fsec-print/main.c | 8 +++++++- test/compile/compile.sh | 19 ++++++++++++++++++- 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/firejail/main.c b/src/firejail/main.c index 922ba2edb..d550e8df9 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c @@ -966,8 +966,15 @@ static void run_builder(int argc, char **argv) { exit(1); } -void filter_add_errno(int fd, int syscall, int arg, void *ptrarg, bool native) {} +void filter_add_errno(int fd, int syscall, int arg, void *ptrarg, bool native) { + (void) fd; + (void) syscall; + (void) arg; + (void) ptrarg; + (void) native; +} +#ifdef HAVE_SECCOMP static int check_postexec(const char *list) { char *prelist, *postlist; @@ -978,6 +985,7 @@ static int check_postexec(const char *list) { } return 0; } +#endif //******************************************* // Main program diff --git a/src/firejail/seccomp.c b/src/firejail/seccomp.c index b0a48591e..612ece85d 100644 --- a/src/firejail/seccomp.c +++ b/src/firejail/seccomp.c @@ -324,14 +324,12 @@ int seccomp_filter_keep(bool native) { if (arg_debug) printf("Build keep seccomp filter\n"); - const char *command, *filter, *postexec_filter, *list; + const char *filter, *postexec_filter, *list; if (native) { - command = "keep"; filter = RUN_SECCOMP_CFG; postexec_filter = RUN_SECCOMP_POSTEXEC; list = cfg.seccomp_list_keep; } else { - command = "keep32"; filter = RUN_SECCOMP_32; postexec_filter = RUN_SECCOMP_POSTEXEC_32; list = cfg.seccomp_list_keep32; diff --git a/src/fsec-print/main.c b/src/fsec-print/main.c index 7bb4fd0cd..8b7c68434 100644 --- a/src/fsec-print/main.c +++ b/src/fsec-print/main.c @@ -25,7 +25,13 @@ static void usage(void) { } int arg_quiet = 0; -void filter_add_errno(int fd, int syscall, int arg, void *ptrarg, bool native) {} +void filter_add_errno(int fd, int syscall, int arg, void *ptrarg, bool native) { + (void) fd; + (void) syscall; + (void) arg; + (void) ptrarg; + (void) native; +} int main(int argc, char **argv) { #if 0 diff --git a/test/compile/compile.sh b/test/compile/compile.sh index ccf37dc40..2f9e0ece6 100755 --- a/test/compile/compile.sh +++ b/test/compile/compile.sh @@ -10,7 +10,7 @@ arr[4]="TEST 4: compile firetunnel disabled" arr[5]="TEST 5: compile user namespace disabled" arr[6]="TEST 6: compile network disabled" arr[7]="TEST 7: compile X11 disabled" -arr[8]="deprecated: TEST 8: compile network restricted" +arr[8]="TEST 8: compile selinux" arr[9]="TEST 9: compile file transfer disabled" arr[10]="TEST 10: compile disable whitelist" arr[11]="TEST 11: compile disable global config" @@ -183,6 +183,23 @@ cp output-configure oc7 cp output-make om7 rm output-configure output-make +#***************************************************************** +# TEST 8 +#***************************************************************** +# - enable selinux +#***************************************************************** +print_title "${arr[8]}" +# seccomp +cd firejail +make distclean +./configure --prefix=/usr --enable-selinux --enable-fatal-warnings 2>&1 | tee ../output-configure +make -j4 2>&1 | tee ../output-make +cd .. +grep Warning output-configure output-make > ./report-test8 +grep Error output-configure output-make >> ./report-test8 +cp output-configure oc8 +cp output-make om8 +rm output-configure output-make #***************************************************************** # TEST 9 -- cgit v1.2.3-54-g00ecf