diff options
Diffstat (limited to 'src/firemon/arp.c')
-rw-r--r-- | src/firemon/arp.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/firemon/arp.c b/src/firemon/arp.c index 7cb8ff4c3..014f6a904 100644 --- a/src/firemon/arp.c +++ b/src/firemon/arp.c | |||
@@ -72,17 +72,15 @@ static void print_arp(const char *fname) { | |||
72 | 72 | ||
73 | } | 73 | } |
74 | 74 | ||
75 | void arp(pid_t pid) { | 75 | void arp(pid_t pid, int print_procs) { |
76 | if (getuid() == 0) | ||
77 | firemon_drop_privs(); | ||
78 | |||
79 | pid_read(pid); | 76 | pid_read(pid); |
80 | 77 | ||
81 | // print processes | 78 | // print processes |
82 | int i; | 79 | int i; |
83 | for (i = 0; i < max_pids; i++) { | 80 | for (i = 0; i < max_pids; i++) { |
84 | if (pids[i].level == 1) { | 81 | if (pids[i].level == 1) { |
85 | pid_print_list(i, 0); | 82 | if (print_procs || pid == 0) |
83 | pid_print_list(i, 0); | ||
86 | int child = find_child(i); | 84 | int child = find_child(i); |
87 | if (child != -1) { | 85 | if (child != -1) { |
88 | char *fname; | 86 | char *fname; |
@@ -90,10 +88,10 @@ void arp(pid_t pid) { | |||
90 | errExit("asprintf"); | 88 | errExit("asprintf"); |
91 | print_arp(fname); | 89 | print_arp(fname); |
92 | free(fname); | 90 | free(fname); |
93 | printf("\n"); | ||
94 | } | 91 | } |
95 | } | 92 | } |
96 | } | 93 | } |
94 | printf("\n"); | ||
97 | } | 95 | } |
98 | 96 | ||
99 | 97 | ||