diff options
author | 2016-10-29 19:20:40 +0200 | |
---|---|---|
committer | 2016-10-29 19:20:40 +0200 | |
commit | 4109b0dc8c13eace4d143a4a5f59018f9e29785d (patch) | |
tree | 1b3d6f85fa6f6de4ab3f5b78815de9a3c00437e6 /src/fseccomp/main.c | |
parent | added profile for wire (diff) | |
parent | Merge pull request #878 from msva/patch-1 (diff) | |
download | firejail-4109b0dc8c13eace4d143a4a5f59018f9e29785d.tar.gz firejail-4109b0dc8c13eace4d143a4a5f59018f9e29785d.tar.zst firejail-4109b0dc8c13eace4d143a4a5f59018f9e29785d.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/fseccomp/main.c')
-rw-r--r-- | src/fseccomp/main.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/fseccomp/main.c b/src/fseccomp/main.c new file mode 100644 index 000000000..59d426a78 --- /dev/null +++ b/src/fseccomp/main.c | |||
@@ -0,0 +1,42 @@ | |||
1 | #include "fseccomp.h" | ||
2 | |||
3 | static void usage(void) { | ||
4 | printf("Usage:\n"); | ||
5 | printf("\tfseccomp debug-syscalls\n"); | ||
6 | printf("\tfseccomp debug-errnos\n"); | ||
7 | printf("\tfseccomp debug-protocols\n"); | ||
8 | printf("\tfseccomp protocol build list file\n"); | ||
9 | } | ||
10 | |||
11 | int main(int argc, char **argv) { | ||
12 | //#if 0 | ||
13 | { | ||
14 | //system("cat /proc/self/status"); | ||
15 | int i; | ||
16 | for (i = 0; i < argc; i++) | ||
17 | printf("*%s* ", argv[i]); | ||
18 | printf("\n"); | ||
19 | } | ||
20 | //#endif | ||
21 | if (argc < 2) | ||
22 | return 1; | ||
23 | |||
24 | if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") ==0) { | ||
25 | usage(); | ||
26 | return 0; | ||
27 | } | ||
28 | else if (argc == 2 && strcmp(argv[1], "debug-syscalls") == 0) | ||
29 | syscall_print(); | ||
30 | else if (argc == 2 && strcmp(argv[1], "debug-errnos") == 0) | ||
31 | errno_print(); | ||
32 | else if (argc == 2 && strcmp(argv[1], "debug-protocols") == 0) | ||
33 | protocol_print(); | ||
34 | else if (argc == 5 && strcmp(argv[1], "protocol") == 0 && strcmp(argv[2], "build") == 0) | ||
35 | protocol_build_filter(argv[3], argv[4]); | ||
36 | else { | ||
37 | fprintf(stderr, "Error fseccomp: invalid arguments\n"); | ||
38 | return 1; | ||
39 | } | ||
40 | |||
41 | return 0; | ||
42 | } \ No newline at end of file | ||