diff options
author | netblue30 <netblue30@yahoo.com> | 2016-05-07 10:05:29 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-05-07 10:05:29 -0400 |
commit | 571e8a53d6f083de8c6c90cdc9e6c48c31bb2702 (patch) | |
tree | 53f63b3f9ec76c2d958246fe8e184b71615604d4 /test | |
parent | Merge pull request #502 from Fred-Barclay/xapps (diff) | |
download | firejail-571e8a53d6f083de8c6c90cdc9e6c48c31bb2702.tar.gz firejail-571e8a53d6f083de8c6c90cdc9e6c48c31bb2702.tar.zst firejail-571e8a53d6f083de8c6c90cdc9e6c48c31bb2702.zip |
fix private-etc empty list
Diffstat (limited to 'test')
-rwxr-xr-x | test/fs/fs.sh | 3 | ||||
-rwxr-xr-x | test/fs/private-etc-empty.exp | 38 | ||||
-rw-r--r-- | test/fs/private-etc-empty.profile | 1 |
3 files changed, 42 insertions, 0 deletions
diff --git a/test/fs/fs.sh b/test/fs/fs.sh index 0fcffcb8e..b49aadf02 100755 --- a/test/fs/fs.sh +++ b/test/fs/fs.sh | |||
@@ -24,6 +24,9 @@ echo "TESTING: private (test/fs/private.exp)" | |||
24 | echo "TESTING: private-etc (test/fs/private-etc.exp)" | 24 | echo "TESTING: private-etc (test/fs/private-etc.exp)" |
25 | ./private-etc.exp | 25 | ./private-etc.exp |
26 | 26 | ||
27 | echo "TESTING: empty private-etc (test/fs/private-etc-empty.exp)" | ||
28 | ./private-etc-empty.exp | ||
29 | |||
27 | echo "TESTING: private-bin (test/fs/private-bin.exp)" | 30 | echo "TESTING: private-bin (test/fs/private-bin.exp)" |
28 | ./private-bin.exp | 31 | ./private-bin.exp |
29 | 32 | ||
diff --git a/test/fs/private-etc-empty.exp b/test/fs/private-etc-empty.exp new file mode 100755 index 000000000..13e917a5c --- /dev/null +++ b/test/fs/private-etc-empty.exp | |||
@@ -0,0 +1,38 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 30 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --private-etc=blablabla\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "Child process initialized" | ||
14 | } | ||
15 | sleep 1 | ||
16 | |||
17 | send -- "ls -l /etc | wc -l\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 1\n";exit} | ||
20 | "0" | ||
21 | } | ||
22 | send -- "exit\r" | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "firejail --profile=private-etc-empty.profile\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 0\n";exit} | ||
28 | "Child process initialized" | ||
29 | } | ||
30 | sleep 1 | ||
31 | |||
32 | send -- "ls -l /etc | wc -l\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 1\n";exit} | ||
35 | "0" | ||
36 | } | ||
37 | |||
38 | puts "\nall done\n" | ||
diff --git a/test/fs/private-etc-empty.profile b/test/fs/private-etc-empty.profile new file mode 100644 index 000000000..38aa8cd68 --- /dev/null +++ b/test/fs/private-etc-empty.profile | |||
@@ -0,0 +1 @@ | |||
private-etc blablabla | |||