diff options
author | netblue30 <netblue30@yahoo.com> | 2015-08-28 12:38:03 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2015-08-28 12:38:03 -0400 |
commit | 7e30149e2e1d31c764673273a7e27cb38f67687d (patch) | |
tree | 3a87c36a8b1287c8454494e9279b057decf113ef /test | |
parent | fix firejail-in-firejail again (diff) | |
download | firejail-7e30149e2e1d31c764673273a7e27cb38f67687d.tar.gz firejail-7e30149e2e1d31c764673273a7e27cb38f67687d.tar.zst firejail-7e30149e2e1d31c764673273a7e27cb38f67687d.zip |
don't blacklist directory links, print a warning
Diffstat (limited to 'test')
-rwxr-xr-x | test/blacklist-link.exp | 50 | ||||
-rw-r--r-- | test/blacklist3.profile | 1 | ||||
-rwxr-xr-x | test/test.sh | 6 |
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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | # blacklist a directory symlink | ||
8 | send -- "firejail --blacklist=auto2\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 1\n";exit} | ||
11 | "directory link was not blacklisted" | ||
12 | } | ||
13 | expect { | ||
14 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
15 | "Child process initialized" | ||
16 | } | ||
17 | sleep 1 | ||
18 | |||
19 | send -- "file auto2\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 2\n";exit} | ||
22 | "symbolic link to" | ||
23 | } | ||
24 | send -- "exit\r" | ||
25 | sleep 1 | ||
26 | |||
27 | # blacklist a directory symlink from a profile file | ||
28 | send -- "firejail --profile=blacklist3.profile\r" | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 3\n";exit} | ||
31 | "directory link was not blacklisted" | ||
32 | } | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
35 | "Child process initialized" | ||
36 | } | ||
37 | sleep 1 | ||
38 | |||
39 | send -- "file auto2\r" | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 4\n";exit} | ||
42 | "symbolic link to" | ||
43 | } | ||
44 | send -- "exit\r" | ||
45 | sleep 1 | ||
46 | |||
47 | |||
48 | |||
49 | puts "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 |
16 | rm -fr dir\ with\ space | 16 | rm -fr dir\ with\ space |
17 | 17 | ||
18 | ln -s auto auto2 | ||
19 | echo "TESTING: blacklist directory link" | ||
20 | ./blacklist-link.exp | ||
21 | rm -fr auto2 | ||
22 | |||
23 | |||
18 | echo "TESTING: version" | 24 | echo "TESTING: version" |
19 | ./option_version.exp | 25 | ./option_version.exp |
20 | 26 | ||