summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README2
-rwxr-xr-xtest/filters/filters.sh3
-rwxr-xr-xtest/filters/seccomp-numeric.exp44
3 files changed, 49 insertions, 0 deletions
diff --git a/README b/README
index 9b2347f90..556dd158f 100644
--- a/README
+++ b/README
@@ -99,6 +99,8 @@ announ (https://github.com/announ)
99Antonio Russo (https://github.com/aerusso) 99Antonio Russo (https://github.com/aerusso)
100 - enumerate root directories in apparmor profile 100 - enumerate root directories in apparmor profile
101 - fix join-or-start 101 - fix join-or-start
102aoand (https://github.com/aoand)
103 - seccomp fix: allow numeric syscalls
102Austin Morton (https://github.com/apmorton) 104Austin Morton (https://github.com/apmorton)
103 - deterministic-exit-code option 105 - deterministic-exit-code option
104 - private-cwd options 106 - private-cwd options
diff --git a/test/filters/filters.sh b/test/filters/filters.sh
index 114978f65..10e50539b 100755
--- a/test/filters/filters.sh
+++ b/test/filters/filters.sh
@@ -110,6 +110,9 @@ echo "TESTING: seccomp chmod profile - seccomp lists (test/filters/seccomp-chmod
110echo "TESTING: seccomp empty (test/filters/seccomp-empty.exp)" 110echo "TESTING: seccomp empty (test/filters/seccomp-empty.exp)"
111./seccomp-empty.exp 111./seccomp-empty.exp
112 112
113echo "TESTING: seccomp numeric (test/filters/seccomp-numeric.exp)"
114./seccomp-numeric.exp
115
113if [ "$(uname -m)" = "x86_64" ]; then 116if [ "$(uname -m)" = "x86_64" ]; then
114 echo "TESTING: seccomp dual filter (test/filters/seccomp-dualfilter.exp)" 117 echo "TESTING: seccomp dual filter (test/filters/seccomp-dualfilter.exp)"
115 ./seccomp-dualfilter.exp 118 ./seccomp-dualfilter.exp
diff --git a/test/filters/seccomp-numeric.exp b/test/filters/seccomp-numeric.exp
new file mode 100755
index 000000000..77f6d60b0
--- /dev/null
+++ b/test/filters/seccomp-numeric.exp
@@ -0,0 +1,44 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2019 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "touch seccomp-test-file\r"
11after 100
12
13send -- "firejail --seccomp=unlinkat:ENOENT,mkdir:ENOENT rm seccomp-test-file\r"
14expect {
15 timeout {puts "TESTING ERROR 0\n";exit}
16 "No such file or directory"
17}
18after 100
19
20send -- "firejail --seccomp=\\\$263:ENOENT,mkdir:ENOENT rm seccomp-test-file\r"
21expect {
22 timeout {puts "TESTING ERROR 1\n";exit}
23 "No such file or directory"
24}
25after 100
26
27send -- "firejail --seccomp=unlinkat:ENOENT,mkdir:ENOENT mkdir seccomp-test-dir\r"
28expect {
29 timeout {puts "TESTING ERROR 2\n";exit}
30 "No such file or directory"
31}
32after 100
33
34send -- "firejail --seccomp=unlinkat:ENOENT,\\\$83:ENOENT mkdir seccomp-test-dir\r"
35expect {
36 timeout {puts "TESTING ERROR 3\n";exit}
37 "No such file or directory"
38}
39after 100
40
41send -- "rm seccomp-test-file\r"
42#send -- "rm -fr seccomp-test-dir\r"
43after 100
44puts "all done\n"