diff options
author | startx2017 <vradu.startx@yandex.com> | 2018-09-06 07:23:28 -0400 |
---|---|---|
committer | startx2017 <vradu.startx@yandex.com> | 2018-09-06 07:23:28 -0400 |
commit | 5a87f3e8b11e3ee80ddee5e4d037a0a7dc087561 (patch) | |
tree | 593e9f52d2df1e24961af04377320e4d073693dc | |
parent | mainline merge (diff) | |
download | firejail-5a87f3e8b11e3ee80ddee5e4d037a0a7dc087561.tar.gz firejail-5a87f3e8b11e3ee80ddee5e4d037a0a7dc087561.tar.zst firejail-5a87f3e8b11e3ee80ddee5e4d037a0a7dc087561.zip |
mainline merges
-rw-r--r-- | src/firejail/sbox.c | 1 | ||||
-rw-r--r-- | src/libpostexecseccomp/libpostexecseccomp.c | 4 | ||||
-rwxr-xr-x | test/environment/nice.exp | 30 |
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 | } |
15 | sleep 1 | 15 | sleep 1 |
16 | 16 | ||
17 | send -- "top -b -n 1\r" | 17 | send -- "top -b -n 1 | awk '{ print \$4, \$12 }'\r" |
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 1\n";exit} | ||
20 | $env(USER) | ||
21 | } | ||
22 | expect { | 18 | expect { |
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 | } |
30 | expect { | 26 | expect { |
31 | timeout {puts "TESTING ERROR 4\n";exit} | ||
32 | $env(USER) | ||
33 | } | ||
34 | expect { | ||
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 | } |
52 | sleep 1 | 44 | sleep 1 |
53 | 45 | ||
54 | send -- "top -b -n 1\r" | 46 | send -- "top -b -n 1 | awk '{ print \$4, \$12 }'\r" |
55 | expect { | ||
56 | timeout {puts "TESTING ERROR 11\n";exit} | ||
57 | $env(USER) | ||
58 | } | ||
59 | expect { | 47 | expect { |
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 | } |
67 | expect { | 55 | expect { |
68 | timeout {puts "TESTING ERROR 14\n";exit} | ||
69 | $env(USER) | ||
70 | } | ||
71 | expect { | ||
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 | } |
91 | sleep 1 | 75 | sleep 1 |
92 | 76 | ||
93 | send -- "top -b -n 1\r" | 77 | send -- "top -b -n 1 | awk '{ print \$4, \$12 }'\r" |
94 | expect { | ||
95 | timeout {puts "TESTING ERROR 18\n";exit} | ||
96 | $env(USER) | ||
97 | } | ||
98 | expect { | 78 | expect { |
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 | } |
106 | expect { | 86 | expect { |
107 | timeout {puts "TESTING ERROR 21\n";exit} | ||
108 | $env(USER) | ||
109 | } | ||
110 | expect { | ||
111 | timeout {puts "TESTING ERROR 22\n";exit} | 87 | timeout {puts "TESTING ERROR 22\n";exit} |
112 | "0" | 88 | "0" |
113 | } | 89 | } |