diff options
author | 2020-08-22 07:45:58 -0400 | |
---|---|---|
committer | 2020-08-22 07:45:58 -0400 | |
commit | 07472ed702f416f8c684de8baff3b32761ebc32a (patch) | |
tree | 4bfeb5e53e2ae379dd30a80421ff29cdf1293a09 /src/fsec-optimize | |
parent | cleaning up POSTMORTEM code (diff) | |
parent | Merge pull request #3572 from smitsohu/dumpable (diff) | |
download | firejail-07472ed702f416f8c684de8baff3b32761ebc32a.tar.gz firejail-07472ed702f416f8c684de8baff3b32761ebc32a.tar.zst firejail-07472ed702f416f8c684de8baff3b32761ebc32a.zip |
Merge branch 'master' of https://github.com/netblue30/firejail
Diffstat (limited to 'src/fsec-optimize')
-rw-r--r-- | src/fsec-optimize/fsec_optimize.h | 1 | ||||
-rw-r--r-- | src/fsec-optimize/main.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/fsec-optimize/fsec_optimize.h b/src/fsec-optimize/fsec_optimize.h index 211111641..034fde2ac 100644 --- a/src/fsec-optimize/fsec_optimize.h +++ b/src/fsec-optimize/fsec_optimize.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #include "../include/common.h" | 22 | #include "../include/common.h" |
23 | #include "../include/seccomp.h" | 23 | #include "../include/seccomp.h" |
24 | #include <sys/mman.h> | 24 | #include <sys/mman.h> |
25 | #include <sys/prctl.h> | ||
25 | 26 | ||
26 | // optimize.c | 27 | // optimize.c |
27 | struct sock_filter *duplicate(struct sock_filter *filter, int entries); | 28 | struct sock_filter *duplicate(struct sock_filter *filter, int entries); |
diff --git a/src/fsec-optimize/main.c b/src/fsec-optimize/main.c index 416d85b88..fb13eeca8 100644 --- a/src/fsec-optimize/main.c +++ b/src/fsec-optimize/main.c | |||
@@ -44,6 +44,12 @@ printf("\n"); | |||
44 | return 0; | 44 | return 0; |
45 | } | 45 | } |
46 | 46 | ||
47 | #ifdef WARN_DUMPABLE | ||
48 | // check FIREJAIL_PLUGIN in order to not print a warning during make | ||
49 | if (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) == 1 && getuid() && getenv("FIREJAIL_PLUGIN")) | ||
50 | fprintf(stderr, "Error fsec-optimize: I am dumpable\n"); | ||
51 | #endif | ||
52 | |||
47 | char *fname = argv[1]; | 53 | char *fname = argv[1]; |
48 | 54 | ||
49 | // open input file | 55 | // open input file |