diff options
Diffstat (limited to 'test/fs/invalid_filename.exp')
-rwxr-xr-x | test/fs/invalid_filename.exp | 189 |
1 files changed, 189 insertions, 0 deletions
diff --git a/test/fs/invalid_filename.exp b/test/fs/invalid_filename.exp new file mode 100755 index 000000000..1acc85491 --- /dev/null +++ b/test/fs/invalid_filename.exp | |||
@@ -0,0 +1,189 @@ | |||
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 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --debug-check-filename --noprofile --blacklist=\"bla&&bla\"\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
13 | "Checking filename bla&&bla" | ||
14 | } | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
17 | "Error:" | ||
18 | } | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
21 | "is an invalid filename" | ||
22 | } | ||
23 | after 100 | ||
24 | |||
25 | send -- "firejail --debug-check-filename --noprofile --cgroup=\"bla&&bla\"\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 2.1\n";exit} | ||
28 | "Checking filename bla&&bla" | ||
29 | } | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 2.2\n";exit} | ||
32 | "Error:" | ||
33 | } | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 2.3\n";exit} | ||
36 | "is an invalid filename" | ||
37 | } | ||
38 | after 100 | ||
39 | |||
40 | send -- "firejail --debug-check-filename --noprofile --chroot=\"bla&&bla\"\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
43 | "Checking filename bla&&bla" {puts "normal system\n"} | ||
44 | "Error: --chroot option is not available on Grsecurity systems" { puts "\nall done\n"; exit} | ||
45 | } | ||
46 | expect { | ||
47 | timeout {puts "TESTING ERROR 3.2\n";exit} | ||
48 | "Error:" | ||
49 | } | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 3.3\n";exit} | ||
52 | "is an invalid filename" | ||
53 | } | ||
54 | after 100 | ||
55 | |||
56 | send -- "firejail --debug-check-filename --noprofile --netfilter=\"bla&&bla\"\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 4.1\n";exit} | ||
59 | "Checking filename bla&&bla" | ||
60 | } | ||
61 | expect { | ||
62 | timeout {puts "TESTING ERROR 4.2\n";exit} | ||
63 | "Error:" | ||
64 | } | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 4.3\n";exit} | ||
67 | "is an invalid filename" | ||
68 | } | ||
69 | after 100 | ||
70 | |||
71 | send -- "firejail --debug-check-filename --noprofile --output=\"bla&&bla\"\r" | ||
72 | expect { | ||
73 | timeout {puts "TESTING ERROR 5.2\n";exit} | ||
74 | "Error:" | ||
75 | } | ||
76 | expect { | ||
77 | timeout {puts "TESTING ERROR 5.3\n";exit} | ||
78 | "is an invalid filename" | ||
79 | } | ||
80 | after 100 | ||
81 | |||
82 | send -- "firejail --debug-check-filename --noprofile --private=\"bla&&bla\"\r" | ||
83 | expect { | ||
84 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
85 | "Checking filename bla&&bla" | ||
86 | } | ||
87 | expect { | ||
88 | timeout {puts "TESTING ERROR 6.2\n";exit} | ||
89 | "Error:" | ||
90 | } | ||
91 | expect { | ||
92 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
93 | "is an invalid filename" | ||
94 | } | ||
95 | after 100 | ||
96 | |||
97 | send -- "firejail --debug-check-filename --noprofile --private-bin=\"bla&&bla\"\r" | ||
98 | expect { | ||
99 | timeout {puts "TESTING ERROR 7.1\n";exit} | ||
100 | "Checking filename bla&&bla" | ||
101 | } | ||
102 | expect { | ||
103 | timeout {puts "TESTING ERROR 7.2\n";exit} | ||
104 | "Error:" | ||
105 | } | ||
106 | expect { | ||
107 | timeout {puts "TESTING ERROR 7.3\n";exit} | ||
108 | "is an invalid filename" | ||
109 | } | ||
110 | after 100 | ||
111 | |||
112 | send -- "firejail --debug-check-filename --noprofile --private-etc=\"bla&&bla\"\r" | ||
113 | expect { | ||
114 | timeout {puts "TESTING ERROR 9.1\n";exit} | ||
115 | "Checking filename bla&&bla" | ||
116 | } | ||
117 | expect { | ||
118 | timeout {puts "TESTING ERROR 9.2\n";exit} | ||
119 | "Error:" | ||
120 | } | ||
121 | expect { | ||
122 | timeout {puts "TESTING ERROR 9.3\n";exit} | ||
123 | "is an invalid filename" | ||
124 | } | ||
125 | after 100 | ||
126 | |||
127 | send -- "firejail --debug-check-filename --profile=\"bla&&bla\"\r" | ||
128 | expect { | ||
129 | timeout {puts "TESTING ERROR 10.1\n";exit} | ||
130 | "Checking filename bla&&bla" | ||
131 | } | ||
132 | expect { | ||
133 | timeout {puts "TESTING ERROR 10.2\n";exit} | ||
134 | "Error:" | ||
135 | } | ||
136 | expect { | ||
137 | timeout {puts "TESTING ERROR 10.3\n";exit} | ||
138 | "is an invalid filename" | ||
139 | } | ||
140 | after 100 | ||
141 | |||
142 | send -- "firejail --debug-check-filename --read-only=\"bla&&bla\"\r" | ||
143 | expect { | ||
144 | timeout {puts "TESTING ERROR 11.1\n";exit} | ||
145 | "Checking filename bla&&bla" | ||
146 | } | ||
147 | expect { | ||
148 | timeout {puts "TESTING ERROR 11.2\n";exit} | ||
149 | "Error:" | ||
150 | } | ||
151 | expect { | ||
152 | timeout {puts "TESTING ERROR 11.3\n";exit} | ||
153 | "is an invalid filename" | ||
154 | } | ||
155 | after 100 | ||
156 | |||
157 | send -- "firejail --debug-check-filename --shell=\"bla&&bla\"\r" | ||
158 | expect { | ||
159 | timeout {puts "TESTING ERROR 12.1\n";exit} | ||
160 | "Checking filename bla&&bla" | ||
161 | } | ||
162 | expect { | ||
163 | timeout {puts "TESTING ERROR 12.2\n";exit} | ||
164 | "Error:" | ||
165 | } | ||
166 | expect { | ||
167 | timeout {puts "TESTING ERROR 12.3\n";exit} | ||
168 | "is an invalid filename" | ||
169 | } | ||
170 | after 100 | ||
171 | |||
172 | |||
173 | send -- "firejail --debug-check-filename --whitelist=\"bla&&bla\"\r" | ||
174 | expect { | ||
175 | timeout {puts "TESTING ERROR 14.1\n";exit} | ||
176 | "Checking filename bla&&bla" | ||
177 | } | ||
178 | expect { | ||
179 | timeout {puts "TESTING ERROR 14.2\n";exit} | ||
180 | "Error:" | ||
181 | } | ||
182 | expect { | ||
183 | timeout {puts "TESTING ERROR 14.3\n";exit} | ||
184 | "is an invalid filename" | ||
185 | } | ||
186 | after 100 | ||
187 | |||
188 | puts "\nall done\n" | ||
189 | |||