From 9e3b7b90cf9aad35fc8db2eabdeb9e1ed038acea Mon Sep 17 00:00:00 2001 From: smitsohu Date: Mon, 17 Aug 2020 17:08:43 +0200 Subject: add dumpable warnings --- src/fcopy/main.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/fcopy/main.c') diff --git a/src/fcopy/main.c b/src/fcopy/main.c index 83d9c17e6..bda7e2f1b 100644 --- a/src/fcopy/main.c +++ b/src/fcopy/main.c @@ -23,6 +23,7 @@ #include #include #include +#include #if HAVE_SELINUX #include @@ -411,6 +412,11 @@ int main(int argc, char **argv) { exit(1); } +#ifdef WARN_DUMPABLE + if (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) == 1 && getuid() && getenv("FIREJAIL_PLUGIN")) + fprintf(stderr, "Error fcopy: I am dumpable\n"); +#endif + // trim trailing chars if (src[strlen(src) - 1] == '/') src[strlen(src) - 1] = '\0'; -- cgit v1.2.3-54-g00ecf