aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-10-17 08:41:39 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-10-17 08:41:39 -0400
commitbb6c744fd4f59d0f407c37955ba36f8d40cc60cf (patch)
treed87a3fa6e00e254466f5a487d1eda0f032a0669e /test
parentmerges (diff)
downloadfirejail-bb6c744fd4f59d0f407c37955ba36f8d40cc60cf.tar.gz
firejail-bb6c744fd4f59d0f407c37955ba36f8d40cc60cf.tar.zst
firejail-bb6c744fd4f59d0f407c37955ba36f8d40cc60cf.zip
allow user access to /sys/fs (--noblacklist=/sys/fs)
Diffstat (limited to 'test')
-rwxr-xr-xtest/fs/fs.sh3
-rwxr-xr-xtest/fs/sys_fs.exp44
2 files changed, 47 insertions, 0 deletions
diff --git a/test/fs/fs.sh b/test/fs/fs.sh
index d45ef48bd..3139b8eae 100755
--- a/test/fs/fs.sh
+++ b/test/fs/fs.sh
@@ -6,6 +6,9 @@
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8 8
9echo "TESTING: /sys/fs access (test/fs/sys_fs.exp)"
10./sys_fs.exp
11
9echo "TESTING: kmsg access (test/fs/kmsg.exp)" 12echo "TESTING: kmsg access (test/fs/kmsg.exp)"
10./kmsg.exp 13./kmsg.exp
11 14
diff --git a/test/fs/sys_fs.exp b/test/fs/sys_fs.exp
new file mode 100755
index 000000000..f512776d9
--- /dev/null
+++ b/test/fs/sys_fs.exp
@@ -0,0 +1,44 @@
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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail\r"
11expect {
12 timeout {puts "TESTING ERROR 1\n";exit}
13 "Child process initialized"
14}
15sleep 1
16
17send -- "ls /sys/fs\r"
18expect {
19 timeout {puts "TESTING ERROR 2\n";exit}
20 "Permission denied"
21}
22after 100
23
24send -- "exit\r"
25sleep 1
26
27send -- "firejail --noblacklist=/sys/fs\r"
28expect {
29 timeout {puts "TESTING ERROR 1\n";exit}
30 "Child process initialized"
31}
32sleep 1
33
34send -- "ls /sys/fs\r"
35expect {
36 timeout {puts "TESTING ERROR 2\n";exit}
37 "cgroup"
38}
39after 100
40send -- "exit\r"
41after 100
42
43puts "\nall done\n"
44