aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-08-28 12:38:03 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2015-08-28 12:38:03 -0400
commit7e30149e2e1d31c764673273a7e27cb38f67687d (patch)
tree3a87c36a8b1287c8454494e9279b057decf113ef /test
parentfix firejail-in-firejail again (diff)
downloadfirejail-7e30149e2e1d31c764673273a7e27cb38f67687d.tar.gz
firejail-7e30149e2e1d31c764673273a7e27cb38f67687d.tar.zst
firejail-7e30149e2e1d31c764673273a7e27cb38f67687d.zip
don't blacklist directory links, print a warning
Diffstat (limited to 'test')
-rwxr-xr-xtest/blacklist-link.exp50
-rw-r--r--test/blacklist3.profile1
-rwxr-xr-xtest/test.sh6
3 files changed, 57 insertions, 0 deletions
diff --git a/test/blacklist-link.exp b/test/blacklist-link.exp
new file mode 100755
index 000000000..da52cae4a
--- /dev/null
+++ b/test/blacklist-link.exp
@@ -0,0 +1,50 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# blacklist a directory symlink
8send -- "firejail --blacklist=auto2\r"
9expect {
10 timeout {puts "TESTING ERROR 1\n";exit}
11 "directory link was not blacklisted"
12}
13expect {
14 timeout {puts "TESTING ERROR 1.1\n";exit}
15 "Child process initialized"
16}
17sleep 1
18
19send -- "file auto2\r"
20expect {
21 timeout {puts "TESTING ERROR 2\n";exit}
22 "symbolic link to"
23}
24send -- "exit\r"
25sleep 1
26
27# blacklist a directory symlink from a profile file
28send -- "firejail --profile=blacklist3.profile\r"
29expect {
30 timeout {puts "TESTING ERROR 3\n";exit}
31 "directory link was not blacklisted"
32}
33expect {
34 timeout {puts "TESTING ERROR 3.1\n";exit}
35 "Child process initialized"
36}
37sleep 1
38
39send -- "file auto2\r"
40expect {
41 timeout {puts "TESTING ERROR 4\n";exit}
42 "symbolic link to"
43}
44send -- "exit\r"
45sleep 1
46
47
48
49puts "all done\n"
50
diff --git a/test/blacklist3.profile b/test/blacklist3.profile
new file mode 100644
index 000000000..08f754f3f
--- /dev/null
+++ b/test/blacklist3.profile
@@ -0,0 +1 @@
blacklist auto2
diff --git a/test/test.sh b/test/test.sh
index 8ddbc476f..8c6be8ddd 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -15,6 +15,12 @@ echo "TESTING: blacklist"
15./blacklist.exp 15./blacklist.exp
16rm -fr dir\ with\ space 16rm -fr dir\ with\ space
17 17
18ln -s auto auto2
19echo "TESTING: blacklist directory link"
20./blacklist-link.exp
21rm -fr auto2
22
23
18echo "TESTING: version" 24echo "TESTING: version"
19./option_version.exp 25./option_version.exp
20 26