diff options
author | smitsohu <smitsohu@gmail.com> | 2020-08-17 17:08:43 +0200 |
---|---|---|
committer | smitsohu <smitsohu@gmail.com> | 2020-08-17 17:08:43 +0200 |
commit | 9e3b7b90cf9aad35fc8db2eabdeb9e1ed038acea (patch) | |
tree | c6732e4a925e5f594cf30db251db9e8e65d3b0e7 /src/fldd/main.c | |
parent | various x11 xorg enhancements (diff) | |
download | firejail-9e3b7b90cf9aad35fc8db2eabdeb9e1ed038acea.tar.gz firejail-9e3b7b90cf9aad35fc8db2eabdeb9e1ed038acea.tar.zst firejail-9e3b7b90cf9aad35fc8db2eabdeb9e1ed038acea.zip |
add dumpable warnings
Diffstat (limited to 'src/fldd/main.c')
-rw-r--r-- | src/fldd/main.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/fldd/main.c b/src/fldd/main.c index dd22e601e..567f6c566 100644 --- a/src/fldd/main.c +++ b/src/fldd/main.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <fcntl.h> | 24 | #include <fcntl.h> |
25 | #include <sys/mman.h> | 25 | #include <sys/mman.h> |
26 | #include <sys/mount.h> | 26 | #include <sys/mount.h> |
27 | #include <sys/prctl.h> | ||
27 | #include <sys/stat.h> | 28 | #include <sys/stat.h> |
28 | #include <sys/types.h> | 29 | #include <sys/types.h> |
29 | #include <unistd.h> | 30 | #include <unistd.h> |
@@ -302,6 +303,11 @@ printf("\n"); | |||
302 | return 0; | 303 | return 0; |
303 | } | 304 | } |
304 | 305 | ||
306 | #ifdef WARN_DUMPABLE | ||
307 | if (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) == 1 && getuid() && getenv("FIREJAIL_PLUGIN")) | ||
308 | fprintf(stderr, "Error fldd: I am dumpable\n"); | ||
309 | #endif | ||
310 | |||
305 | // check program access | 311 | // check program access |
306 | if (access(argv[1], R_OK)) { | 312 | if (access(argv[1], R_OK)) { |
307 | fprintf(stderr, "Error fldd: cannot access %s\n", argv[1]); | 313 | fprintf(stderr, "Error fldd: cannot access %s\n", argv[1]); |