diff options
author | startx2017 <vradu.startx@yandex.com> | 2018-05-08 17:57:43 -0400 |
---|---|---|
committer | startx2017 <vradu.startx@yandex.com> | 2018-05-08 17:57:43 -0400 |
commit | 2a0fb5c1edc4455ec7e4a0396b54433aac59d98e (patch) | |
tree | 6881815465a4b2f5fd1a0c6128f8e9f6c7bf44d2 /src/firemon/firemon.c | |
parent | more errLogExit (diff) | |
download | firejail-2a0fb5c1edc4455ec7e4a0396b54433aac59d98e.tar.gz firejail-2a0fb5c1edc4455ec7e4a0396b54433aac59d98e.tar.zst firejail-2a0fb5c1edc4455ec7e4a0396b54433aac59d98e.zip |
don't display firejail --list/--tree/--top processes in firemon stats
Diffstat (limited to 'src/firemon/firemon.c')
-rw-r--r-- | src/firemon/firemon.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/firemon/firemon.c b/src/firemon/firemon.c index 54f0c5fc9..147b5073b 100644 --- a/src/firemon/firemon.c +++ b/src/firemon/firemon.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <grp.h> | 25 | #include <grp.h> |
26 | #include <sys/stat.h> | 26 | #include <sys/stat.h> |
27 | 27 | ||
28 | pid_t skip_process = 0; | ||
28 | static int arg_route = 0; | 29 | static int arg_route = 0; |
29 | static int arg_arp = 0; | 30 | static int arg_arp = 0; |
30 | static int arg_tree = 0; | 31 | static int arg_tree = 0; |
@@ -217,6 +218,13 @@ int main(int argc, char **argv) { | |||
217 | } | 218 | } |
218 | } | 219 | } |
219 | 220 | ||
221 | |||
222 | // if the parent is firejail, skip the process | ||
223 | pid_t ppid = getppid(); | ||
224 | char *pcomm = pid_proc_comm(ppid); | ||
225 | if (pcomm && strcmp(pcomm, "firejail") == 0) | ||
226 | skip_process = ppid; | ||
227 | |||
220 | // allow only root user if /proc is mounted hidepid | 228 | // allow only root user if /proc is mounted hidepid |
221 | if (pid_hidepid() && getuid() != 0) { | 229 | if (pid_hidepid() && getuid() != 0) { |
222 | fprintf(stderr, "Error: /proc is mounted hidepid, you would need to be root to run this command\n"); | 230 | fprintf(stderr, "Error: /proc is mounted hidepid, you would need to be root to run this command\n"); |