aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar startx2017 <vradu.startx@yandex.com>2018-09-06 07:23:28 -0400
committerLibravatar startx2017 <vradu.startx@yandex.com>2018-09-06 07:23:28 -0400
commit5a87f3e8b11e3ee80ddee5e4d037a0a7dc087561 (patch)
tree593e9f52d2df1e24961af04377320e4d073693dc
parentmainline merge (diff)
downloadfirejail-5a87f3e8b11e3ee80ddee5e4d037a0a7dc087561.tar.gz
firejail-5a87f3e8b11e3ee80ddee5e4d037a0a7dc087561.tar.zst
firejail-5a87f3e8b11e3ee80ddee5e4d037a0a7dc087561.zip
mainline merges
-rw-r--r--src/firejail/sbox.c1
-rw-r--r--src/libpostexecseccomp/libpostexecseccomp.c4
-rwxr-xr-xtest/environment/nice.exp30
3 files changed, 7 insertions, 28 deletions
diff --git a/src/firejail/sbox.c b/src/firejail/sbox.c
index 1c6f3c327..10c96225a 100644
--- a/src/firejail/sbox.c
+++ b/src/firejail/sbox.c
@@ -139,6 +139,7 @@ int sbox_run(unsigned filter, int num, ...) {
139 exit(1); 139 exit(1);
140 } 140 }
141 dup2(fd,STDIN_FILENO); 141 dup2(fd,STDIN_FILENO);
142 close(fd);
142 } 143 }
143 else if ((filter & SBOX_ALLOW_STDIN) == 0) { 144 else if ((filter & SBOX_ALLOW_STDIN) == 0) {
144 int fd = open("/dev/null",O_RDWR, 0); 145 int fd = open("/dev/null",O_RDWR, 0);
diff --git a/src/libpostexecseccomp/libpostexecseccomp.c b/src/libpostexecseccomp/libpostexecseccomp.c
index de64d50c5..856adb8fe 100644
--- a/src/libpostexecseccomp/libpostexecseccomp.c
+++ b/src/libpostexecseccomp/libpostexecseccomp.c
@@ -32,8 +32,10 @@ static void load_seccomp(void) {
32 return; 32 return;
33 33
34 off_t size = lseek(fd, 0, SEEK_END); 34 off_t size = lseek(fd, 0, SEEK_END);
35 if (size <= 0) 35 if (size <= 0) {
36 close(fd);
36 return; 37 return;
38 }
37 unsigned short entries = (unsigned short) size / (unsigned short) sizeof(struct sock_filter); 39 unsigned short entries = (unsigned short) size / (unsigned short) sizeof(struct sock_filter);
38 struct sock_filter *filter = MAP_FAILED; 40 struct sock_filter *filter = MAP_FAILED;
39 if (size != 0) 41 if (size != 0)
diff --git a/test/environment/nice.exp b/test/environment/nice.exp
index b989ea37a..9a7e2e9f7 100755
--- a/test/environment/nice.exp
+++ b/test/environment/nice.exp
@@ -14,11 +14,7 @@ expect {
14} 14}
15sleep 1 15sleep 1
16 16
17send -- "top -b -n 1\r" 17send -- "top -b -n 1 | awk '{ print \$4, \$12 }'\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 $env(USER)
21}
22expect { 18expect {
23 timeout {puts "TESTING ERROR 2\n";exit} 19 timeout {puts "TESTING ERROR 2\n";exit}
24 "15" 20 "15"
@@ -28,10 +24,6 @@ expect {
28 "bash" 24 "bash"
29} 25}
30expect { 26expect {
31 timeout {puts "TESTING ERROR 4\n";exit}
32 $env(USER)
33}
34expect {
35 timeout {puts "TESTING ERROR 5\n";exit} 27 timeout {puts "TESTING ERROR 5\n";exit}
36 "15" 28 "15"
37} 29}
@@ -51,11 +43,7 @@ expect {
51} 43}
52sleep 1 44sleep 1
53 45
54send -- "top -b -n 1\r" 46send -- "top -b -n 1 | awk '{ print \$4, \$12 }'\r"
55expect {
56 timeout {puts "TESTING ERROR 11\n";exit}
57 $env(USER)
58}
59expect { 47expect {
60 timeout {puts "TESTING ERROR 12\n";exit} 48 timeout {puts "TESTING ERROR 12\n";exit}
61 "15" 49 "15"
@@ -65,10 +53,6 @@ expect {
65 "bash" 53 "bash"
66} 54}
67expect { 55expect {
68 timeout {puts "TESTING ERROR 14\n";exit}
69 $env(USER)
70}
71expect {
72 timeout {puts "TESTING ERROR 15\n";exit} 56 timeout {puts "TESTING ERROR 15\n";exit}
73 "15" 57 "15"
74} 58}
@@ -90,11 +74,7 @@ expect {
90} 74}
91sleep 1 75sleep 1
92 76
93send -- "top -b -n 1\r" 77send -- "top -b -n 1 | awk '{ print \$4, \$12 }'\r"
94expect {
95 timeout {puts "TESTING ERROR 18\n";exit}
96 $env(USER)
97}
98expect { 78expect {
99 timeout {puts "TESTING ERROR 19\n";exit} 79 timeout {puts "TESTING ERROR 19\n";exit}
100 "0" 80 "0"
@@ -104,10 +84,6 @@ expect {
104 "bash" 84 "bash"
105} 85}
106expect { 86expect {
107 timeout {puts "TESTING ERROR 21\n";exit}
108 $env(USER)
109}
110expect {
111 timeout {puts "TESTING ERROR 22\n";exit} 87 timeout {puts "TESTING ERROR 22\n";exit}
112 "0" 88 "0"
113} 89}