diff options
Diffstat (limited to 'src/fseccomp')
-rw-r--r-- | src/fseccomp/fseccomp.h | 1 | ||||
-rw-r--r-- | src/fseccomp/main.c | 16 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/fseccomp/fseccomp.h b/src/fseccomp/fseccomp.h index e8dd083b6..e40999938 100644 --- a/src/fseccomp/fseccomp.h +++ b/src/fseccomp/fseccomp.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <stdlib.h> | 23 | #include <stdlib.h> |
24 | #include <string.h> | 24 | #include <string.h> |
25 | #include <assert.h> | 25 | #include <assert.h> |
26 | #include <sys/prctl.h> | ||
26 | #include "../include/common.h" | 27 | #include "../include/common.h" |
27 | #include "../include/syscall.h" | 28 | #include "../include/syscall.h" |
28 | 29 | ||
diff --git a/src/fseccomp/main.c b/src/fseccomp/main.c index 3b3c92b46..f505ca0f3 100644 --- a/src/fseccomp/main.c +++ b/src/fseccomp/main.c | |||
@@ -64,6 +64,16 @@ printf("\n"); | |||
64 | usage(); | 64 | usage(); |
65 | return 1; | 65 | return 1; |
66 | } | 66 | } |
67 | if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") ==0) { | ||
68 | usage(); | ||
69 | return 0; | ||
70 | } | ||
71 | |||
72 | #ifdef WARN_DUMPABLE | ||
73 | // check FIREJAIL_PLUGIN in order to not print a warning during make | ||
74 | if (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) == 1 && getuid() && getenv("FIREJAIL_PLUGIN")) | ||
75 | fprintf(stderr, "Error fseccomp: I am dumpable\n"); | ||
76 | #endif | ||
67 | 77 | ||
68 | char *quiet = getenv("FIREJAIL_QUIET"); | 78 | char *quiet = getenv("FIREJAIL_QUIET"); |
69 | if (quiet && strcmp(quiet, "yes") == 0) | 79 | if (quiet && strcmp(quiet, "yes") == 0) |
@@ -83,11 +93,7 @@ printf("\n"); | |||
83 | } | 93 | } |
84 | } | 94 | } |
85 | 95 | ||
86 | if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") ==0) { | 96 | if (argc == 2 && strcmp(argv[1], "debug-syscalls") == 0) |
87 | usage(); | ||
88 | return 0; | ||
89 | } | ||
90 | else if (argc == 2 && strcmp(argv[1], "debug-syscalls") == 0) | ||
91 | syscall_print(); | 97 | syscall_print(); |
92 | else if (argc == 2 && strcmp(argv[1], "debug-syscalls32") == 0) | 98 | else if (argc == 2 && strcmp(argv[1], "debug-syscalls32") == 0) |
93 | syscall_print_32(); | 99 | syscall_print_32(); |