aboutsummaryrefslogtreecommitdiffstats
path: root/src/fseccomp
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2020-08-17 17:08:43 +0200
committerLibravatar smitsohu <smitsohu@gmail.com>2020-08-17 17:08:43 +0200
commit9e3b7b90cf9aad35fc8db2eabdeb9e1ed038acea (patch)
treec6732e4a925e5f594cf30db251db9e8e65d3b0e7 /src/fseccomp
parentvarious x11 xorg enhancements (diff)
downloadfirejail-9e3b7b90cf9aad35fc8db2eabdeb9e1ed038acea.tar.gz
firejail-9e3b7b90cf9aad35fc8db2eabdeb9e1ed038acea.tar.zst
firejail-9e3b7b90cf9aad35fc8db2eabdeb9e1ed038acea.zip
add dumpable warnings
Diffstat (limited to 'src/fseccomp')
-rw-r--r--src/fseccomp/fseccomp.h1
-rw-r--r--src/fseccomp/main.c15
2 files changed, 11 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 892a88e25..6b7800f35 100644
--- a/src/fseccomp/main.c
+++ b/src/fseccomp/main.c
@@ -64,6 +64,15 @@ 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 if (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) == 1 && getuid() && getenv("FIREJAIL_PLUGIN"))
74 fprintf(stderr, "Error fseccomp: I am dumpable\n");
75#endif
67 76
68 char *quiet = getenv("FIREJAIL_QUIET"); 77 char *quiet = getenv("FIREJAIL_QUIET");
69 if (quiet && strcmp(quiet, "yes") == 0) 78 if (quiet && strcmp(quiet, "yes") == 0)
@@ -81,11 +90,7 @@ printf("\n");
81 } 90 }
82 } 91 }
83 92
84 if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") ==0) { 93 if (argc == 2 && strcmp(argv[1], "debug-syscalls") == 0)
85 usage();
86 return 0;
87 }
88 else if (argc == 2 && strcmp(argv[1], "debug-syscalls") == 0)
89 syscall_print(); 94 syscall_print();
90 else if (argc == 2 && strcmp(argv[1], "debug-syscalls32") == 0) 95 else if (argc == 2 && strcmp(argv[1], "debug-syscalls32") == 0)
91 syscall_print_32(); 96 syscall_print_32();