aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-04-06 14:56:04 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-04-06 14:56:04 -0400
commit0983bfe3bc58ad83a0a474435a3d7f1adfdb0b71 (patch)
tree913cf0bba1cd5a705685ddb29bafee4a5f074daf
parentman page fix (diff)
downloadfirejail-0983bfe3bc58ad83a0a474435a3d7f1adfdb0b71.tar.gz
firejail-0983bfe3bc58ad83a0a474435a3d7f1adfdb0b71.tar.zst
firejail-0983bfe3bc58ad83a0a474435a3d7f1adfdb0b71.zip
grsecurity: --bandwidth
-rw-r--r--src/firejail/bandwidth.c4
-rwxr-xr-xtest/test.sh3
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
9echo "TESTING: bandwidth (bandwidth.exp)"
10./bandwidth.exp
11
9echo "TESTING: file transfer (ls.exp)" 12echo "TESTING: file transfer (ls.exp)"
10./ls.exp 13./ls.exp
11 14