diff options
author | startx2017 <vradu.startx@yandex.com> | 2017-07-07 08:53:30 -0400 |
---|---|---|
committer | startx2017 <vradu.startx@yandex.com> | 2017-07-07 08:53:30 -0400 |
commit | 4a270c553b4edc0e745759670ba0c2b2ca814e1b (patch) | |
tree | d69c669fb96b1a88339d2274bd580f3d9df16913 /src/firemon/firemon.c | |
parent | run --netstats on 1s interval; caching user name. (diff) | |
download | firejail-4a270c553b4edc0e745759670ba0c2b2ca814e1b.tar.gz firejail-4a270c553b4edc0e745759670ba0c2b2ca814e1b.tar.zst firejail-4a270c553b4edc0e745759670ba0c2b2ca814e1b.zip |
fix firemon --name
Diffstat (limited to 'src/firemon/firemon.c')
-rw-r--r-- | src/firemon/firemon.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/firemon/firemon.c b/src/firemon/firemon.c index aaeffdbd2..5861e35ee 100644 --- a/src/firemon/firemon.c +++ b/src/firemon/firemon.c | |||
@@ -201,18 +201,32 @@ int main(int argc, char **argv) { | |||
201 | } | 201 | } |
202 | 202 | ||
203 | if (arg_top) { | 203 | if (arg_top) { |
204 | top(); | 204 | top(); // print all sandboxes, --name disregarded |
205 | return 0; | 205 | return 0; |
206 | } | 206 | } |
207 | if (arg_list) { | 207 | if (arg_list) { |
208 | list(); | 208 | list(); // print all sandboxes, --name disregarded |
209 | return 0; | 209 | return 0; |
210 | } | 210 | } |
211 | if (arg_netstats) { | 211 | if (arg_netstats) { |
212 | netstats(); | 212 | netstats(); // print all sandboxes, --name disregarded |
213 | return 0; | 213 | return 0; |
214 | } | 214 | } |
215 | 215 | ||
216 | // if --name requested without other options, print all data | ||
217 | if (pid && !arg_tree && !arg_cpu && !arg_seccomp && !arg_caps && | ||
218 | !arg_cgroup && !arg_x11 && !arg_interface && !arg_route && !arg_arp) { | ||
219 | arg_tree = 1; | ||
220 | arg_cpu = 1; | ||
221 | arg_seccomp = 1; | ||
222 | arg_caps = 1; | ||
223 | arg_cgroup = 1; | ||
224 | arg_x11 = 1; | ||
225 | arg_interface = 1; | ||
226 | arg_route = 1; | ||
227 | arg_arp = 1; | ||
228 | } | ||
229 | |||
216 | // cumulative options | 230 | // cumulative options |
217 | int print_procs = 1; | 231 | int print_procs = 1; |
218 | if (arg_tree) { | 232 | if (arg_tree) { |
@@ -239,7 +253,7 @@ int main(int argc, char **argv) { | |||
239 | x11((pid_t) pid, print_procs); | 253 | x11((pid_t) pid, print_procs); |
240 | print_procs = 0; | 254 | print_procs = 0; |
241 | } | 255 | } |
242 | if (arg_interface) { | 256 | if (arg_interface && getuid() == 0) { |
243 | interface((pid_t) pid, print_procs); | 257 | interface((pid_t) pid, print_procs); |
244 | print_procs = 0; | 258 | print_procs = 0; |
245 | } | 259 | } |
@@ -252,7 +266,9 @@ int main(int argc, char **argv) { | |||
252 | print_procs = 0; | 266 | print_procs = 0; |
253 | } | 267 | } |
254 | 268 | ||
255 | if (print_procs) | 269 | if (getuid() == 0) |
270 | if (!arg_tree) | ||
271 | tree((pid_t) pid); | ||
256 | procevent((pid_t) pid); | 272 | procevent((pid_t) pid); |
257 | 273 | ||
258 | return 0; | 274 | return 0; |