diff options
-rw-r--r-- | src/firejail/bandwidth.c | 4 | ||||
-rwxr-xr-x | test/test.sh | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/firejail/bandwidth.c b/src/firejail/bandwidth.c index 10032b87a..b7bfb43e6 100644 --- a/src/firejail/bandwidth.c +++ b/src/firejail/bandwidth.c | |||
@@ -360,7 +360,9 @@ void bandwidth_pid(pid_t pid, const char *command, const char *dev, int down, in | |||
360 | //************************ | 360 | //************************ |
361 | // verify sandbox | 361 | // verify sandbox |
362 | //************************ | 362 | //************************ |
363 | EUID_ROOT(); | ||
363 | char *comm = pid_proc_comm(pid); | 364 | char *comm = pid_proc_comm(pid); |
365 | EUID_USER(); | ||
364 | if (!comm) { | 366 | if (!comm) { |
365 | fprintf(stderr, "Error: cannot find sandbox\n"); | 367 | fprintf(stderr, "Error: cannot find sandbox\n"); |
366 | exit(1); | 368 | exit(1); |
@@ -374,7 +376,9 @@ void bandwidth_pid(pid_t pid, const char *command, const char *dev, int down, in | |||
374 | free(comm); | 376 | free(comm); |
375 | 377 | ||
376 | // check network namespace | 378 | // check network namespace |
379 | EUID_ROOT(); | ||
377 | char *cmd = pid_proc_cmdline(pid); | 380 | char *cmd = pid_proc_cmdline(pid); |
381 | EUID_USER(); | ||
378 | if (!cmd || strstr(cmd, "--net") == NULL) { | 382 | if (!cmd || strstr(cmd, "--net") == NULL) { |
379 | fprintf(stderr, "Error: the sandbox doesn't use a new network namespace\n"); | 383 | fprintf(stderr, "Error: the sandbox doesn't use a new network namespace\n"); |
380 | exit(1); | 384 | exit(1); |
diff --git a/test/test.sh b/test/test.sh index 5e2bde52d..ca2108bc5 100755 --- a/test/test.sh +++ b/test/test.sh | |||
@@ -6,6 +6,9 @@ | |||
6 | 6 | ||
7 | ./fscheck.sh | 7 | ./fscheck.sh |
8 | 8 | ||
9 | echo "TESTING: bandwidth (bandwidth.exp)" | ||
10 | ./bandwidth.exp | ||
11 | |||
9 | echo "TESTING: file transfer (ls.exp)" | 12 | echo "TESTING: file transfer (ls.exp)" |
10 | ./ls.exp | 13 | ./ls.exp |
11 | 14 | ||