diff options
author | 2018-08-14 08:59:04 -0400 | |
---|---|---|
committer | 2018-08-14 08:59:04 -0400 | |
commit | c31c9e7769602827b801c423ba5ee0402b49ed78 (patch) | |
tree | 161ad1108dc973dd2ae180456973ef7d71532c45 | |
parent | 0.9.56-rc1 merges (diff) | |
download | firejail-c31c9e7769602827b801c423ba5ee0402b49ed78.tar.gz firejail-c31c9e7769602827b801c423ba5ee0402b49ed78.tar.zst firejail-c31c9e7769602827b801c423ba5ee0402b49ed78.zip |
merge 0.9.56-rc1
-rwxr-xr-x | test/fs/fs.sh | 3 | ||||
-rw-r--r-- | test/fs/macro-blacklist.profile | 6 | ||||
-rw-r--r-- | test/fs/macro-readonly.profile | 6 | ||||
-rw-r--r-- | test/fs/macro-whitelist.profile | 6 | ||||
-rwxr-xr-x | test/fs/macro.exp | 174 | ||||
-rw-r--r-- | test/fs/user-dirs.dirs | 15 |
6 files changed, 195 insertions, 15 deletions
diff --git a/test/fs/fs.sh b/test/fs/fs.sh index 186dca1c0..28f7185da 100755 --- a/test/fs/fs.sh +++ b/test/fs/fs.sh | |||
@@ -49,6 +49,9 @@ echo "TESTING: private-etc (test/fs/private-etc.exp)" | |||
49 | echo "TESTING: empty private-etc (test/fs/private-etc-empty.exp)" | 49 | echo "TESTING: empty private-etc (test/fs/private-etc-empty.exp)" |
50 | ./private-etc-empty.exp | 50 | ./private-etc-empty.exp |
51 | 51 | ||
52 | echo "TESTING: macros (test/fs/macro..exp)" | ||
53 | ./macro.exp | ||
54 | |||
52 | echo "TESTING: whitelist empty (test/fs/whitelist-empty.exp)" | 55 | echo "TESTING: whitelist empty (test/fs/whitelist-empty.exp)" |
53 | ./whitelist-empty.exp | 56 | ./whitelist-empty.exp |
54 | 57 | ||
diff --git a/test/fs/macro-blacklist.profile b/test/fs/macro-blacklist.profile new file mode 100644 index 000000000..2421d1b7c --- /dev/null +++ b/test/fs/macro-blacklist.profile | |||
@@ -0,0 +1,6 @@ | |||
1 | blacklist ${VIDEOS} | ||
2 | blacklist ${DOCUMENTS} | ||
3 | blacklist ${MUSIC} | ||
4 | blacklist ${DOWNLOADS} | ||
5 | blacklist ${PICTURES} | ||
6 | blacklist ${DESKTOP} | ||
diff --git a/test/fs/macro-readonly.profile b/test/fs/macro-readonly.profile new file mode 100644 index 000000000..2f3d5bd78 --- /dev/null +++ b/test/fs/macro-readonly.profile | |||
@@ -0,0 +1,6 @@ | |||
1 | read-only ${VIDEOS} | ||
2 | read-only ${DOCUMENTS} | ||
3 | read-only ${MUSIC} | ||
4 | read-only ${DOWNLOADS} | ||
5 | read-only ${PICTURES} | ||
6 | read-only ${DESKTOP} | ||
diff --git a/test/fs/macro-whitelist.profile b/test/fs/macro-whitelist.profile new file mode 100644 index 000000000..fed7f76fc --- /dev/null +++ b/test/fs/macro-whitelist.profile | |||
@@ -0,0 +1,6 @@ | |||
1 | whitelist ${VIDEOS} | ||
2 | whitelist ${DOCUMENTS} | ||
3 | whitelist ${MUSIC} | ||
4 | whitelist ${DOWNLOADS} | ||
5 | whitelist ${PICTURES} | ||
6 | whitelist ${DESKTOP} | ||
diff --git a/test/fs/macro.exp b/test/fs/macro.exp new file mode 100755 index 000000000..8080a8108 --- /dev/null +++ b/test/fs/macro.exp | |||
@@ -0,0 +1,174 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2018 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | |||
11 | send -- "firejail --profile=macro-whitelist.profile ls ~\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 0\n";exit} | ||
14 | "Child process initialized" | ||
15 | } | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 1\n";exit} | ||
18 | "Desktop" | ||
19 | } | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 2\n";exit} | ||
22 | "Documents" | ||
23 | } | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 3\n";exit} | ||
26 | "Downloads" | ||
27 | } | ||
28 | expect { | ||
29 | timeout {puts "TESTING ERROR 4\n";exit} | ||
30 | "Music" | ||
31 | } | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 5\n";exit} | ||
34 | "Pictures" | ||
35 | } | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 6\n";exit} | ||
38 | "Videos" | ||
39 | } | ||
40 | sleep 1 | ||
41 | |||
42 | send -- "firejail --profile=macro-blacklist.profile ls ~/Desktop\r" | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 7\n";exit} | ||
45 | "Child process initialized" | ||
46 | } | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 8\n";exit} | ||
49 | "Permission denied" | ||
50 | } | ||
51 | sleep 1 | ||
52 | |||
53 | send -- "firejail --profile=macro-blacklist.profile ls ~/Documents\r" | ||
54 | expect { | ||
55 | timeout {puts "TESTING ERROR 9n";exit} | ||
56 | "Child process initialized" | ||
57 | } | ||
58 | expect { | ||
59 | timeout {puts "TESTING ERROR 10\n";exit} | ||
60 | "Permission denied" | ||
61 | } | ||
62 | sleep 1 | ||
63 | |||
64 | send -- "firejail --profile=macro-blacklist.profile ls ~/Downloads\r" | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 11n";exit} | ||
67 | "Child process initialized" | ||
68 | } | ||
69 | expect { | ||
70 | timeout {puts "TESTING ERROR 12n";exit} | ||
71 | "Permission denied" | ||
72 | } | ||
73 | sleep 1 | ||
74 | |||
75 | send -- "firejail --profile=macro-blacklist.profile ls ~/Music\r" | ||
76 | expect { | ||
77 | timeout {puts "TESTING ERROR 13\n";exit} | ||
78 | "Child process initialized" | ||
79 | } | ||
80 | expect { | ||
81 | timeout {puts "TESTING ERROR 14\n";exit} | ||
82 | "Permission denied" | ||
83 | } | ||
84 | sleep 1 | ||
85 | |||
86 | send -- "firejail --profile=macro-blacklist.profile ls ~/Pictures\r" | ||
87 | expect { | ||
88 | timeout {puts "TESTING ERROR 15\n";exit} | ||
89 | "Child process initialized" | ||
90 | } | ||
91 | expect { | ||
92 | timeout {puts "TESTING ERROR 16\n";exit} | ||
93 | "Permission denied" | ||
94 | } | ||
95 | sleep 1 | ||
96 | |||
97 | send -- "firejail --profile=macro-blacklist.profile ls ~/Videos\r" | ||
98 | expect { | ||
99 | timeout {puts "TESTING ERROR 17\n";exit} | ||
100 | "Child process initialized" | ||
101 | } | ||
102 | expect { | ||
103 | timeout {puts "TESTING ERROR 18\n";exit} | ||
104 | "Permission denied" | ||
105 | } | ||
106 | sleep 1 | ||
107 | |||
108 | send -- "firejail --profile=macro-readonly.profile touch ~/Desktop/blablabla\r" | ||
109 | expect { | ||
110 | timeout {puts "TESTING ERROR 19\n";exit} | ||
111 | "Child process initialized" | ||
112 | } | ||
113 | expect { | ||
114 | timeout {puts "TESTING ERROR 20\n";exit} | ||
115 | "Read-only file system" | ||
116 | } | ||
117 | sleep 1 | ||
118 | |||
119 | send -- "firejail --profile=macro-readonly.profile touch ~/Documents/blablabla\r" | ||
120 | expect { | ||
121 | timeout {puts "TESTING ERROR 21\n";exit} | ||
122 | "Child process initialized" | ||
123 | } | ||
124 | expect { | ||
125 | timeout {puts "TESTING ERROR 22\n";exit} | ||
126 | "Read-only file system" | ||
127 | } | ||
128 | sleep 1 | ||
129 | |||
130 | send -- "firejail --profile=macro-readonly.profile touch ~/Downloads/blablabla\r" | ||
131 | expect { | ||
132 | timeout {puts "TESTING ERROR 23\n";exit} | ||
133 | "Child process initialized" | ||
134 | } | ||
135 | expect { | ||
136 | timeout {puts "TESTING ERROR 24\n";exit} | ||
137 | "Read-only file system" | ||
138 | } | ||
139 | sleep 1 | ||
140 | |||
141 | send -- "firejail --profile=macro-readonly.profile touch ~/Music/blablabla\r" | ||
142 | expect { | ||
143 | timeout {puts "TESTING ERROR 25\n";exit} | ||
144 | "Child process initialized" | ||
145 | } | ||
146 | expect { | ||
147 | timeout {puts "TESTING ERROR 26\n";exit} | ||
148 | "Read-only file system" | ||
149 | } | ||
150 | sleep 1 | ||
151 | |||
152 | send -- "firejail --profile=macro-readonly.profile touch ~/Pictures/blablabla\r" | ||
153 | expect { | ||
154 | timeout {puts "TESTING ERROR 27\n";exit} | ||
155 | "Child process initialized" | ||
156 | } | ||
157 | expect { | ||
158 | timeout {puts "TESTING ERROR 28\n";exit} | ||
159 | "Read-only file system" | ||
160 | } | ||
161 | sleep 1 | ||
162 | |||
163 | send -- "firejail --profile=macro-readonly.profile touch ~/Videos/blablabla\r" | ||
164 | expect { | ||
165 | timeout {puts "TESTING ERROR 29\n";exit} | ||
166 | "Child process initialized" | ||
167 | } | ||
168 | expect { | ||
169 | timeout {puts "TESTING ERROR 30\n";exit} | ||
170 | "Read-only file system" | ||
171 | } | ||
172 | sleep 1 | ||
173 | |||
174 | puts "\nall done\n" | ||
diff --git a/test/fs/user-dirs.dirs b/test/fs/user-dirs.dirs deleted file mode 100644 index ea3a3a4c2..000000000 --- a/test/fs/user-dirs.dirs +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | # This file is written by xdg-user-dirs-update | ||
2 | # If you want to change or add directories, just edit the line you're | ||
3 | # interested in. All local changes will be retained on the next run | ||
4 | # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped | ||
5 | # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an | ||
6 | # absolute path. No other format is supported. | ||
7 | # | ||
8 | XDG_DESKTOP_DIR="$HOME/Desktop" | ||
9 | XDG_DOWNLOAD_DIR="$HOME/Downloads" | ||
10 | XDG_TEMPLATES_DIR="$HOME/Templates" | ||
11 | XDG_PUBLICSHARE_DIR="$HOME/Public" | ||
12 | XDG_DOCUMENTS_DIR="$HOME/Documents" | ||
13 | XDG_MUSIC_DIR="$HOME/Music" | ||
14 | XDG_PICTURES_DIR="$HOME/Pictures" | ||
15 | XDG_VIDEOS_DIR="$HOME/Videos" | ||