From 6576b9ee6d682a3b63b88d1d9de3d8fa872bc7ac Mon Sep 17 00:00:00 2001 From: netblue30 Date: Fri, 28 Aug 2015 14:13:15 -0400 Subject: more fixes for blacklist on Arch systems --- test/blacklist-link.exp | 55 +++++++++++++++++++++++++++++++++++++++---------- test/test.sh | 4 ++++ 2 files changed, 48 insertions(+), 11 deletions(-) (limited to 'test') diff --git a/test/blacklist-link.exp b/test/blacklist-link.exp index da52cae4a..84fa6c3f5 100755 --- a/test/blacklist-link.exp +++ b/test/blacklist-link.exp @@ -8,18 +8,14 @@ match_max 100000 send -- "firejail --blacklist=auto2\r" expect { timeout {puts "TESTING ERROR 1\n";exit} - "directory link was not blacklisted" -} -expect { - timeout {puts "TESTING ERROR 1.1\n";exit} "Child process initialized" } sleep 1 -send -- "file auto2\r" +send -- "ls auto2\r" expect { timeout {puts "TESTING ERROR 2\n";exit} - "symbolic link to" + "cannot open directory" } send -- "exit\r" sleep 1 @@ -28,22 +24,59 @@ sleep 1 send -- "firejail --profile=blacklist3.profile\r" expect { timeout {puts "TESTING ERROR 3\n";exit} - "directory link was not blacklisted" + "Child process initialized" +} +sleep 1 + +send -- "ls auto2\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "cannot open directory" +} +send -- "exit\r" +sleep 1 + +# do not blacklist /bin +send -- "firejail --blacklist=auto3\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "auto3 directory link was not blacklisted" } expect { - timeout {puts "TESTING ERROR 3.1\n";exit} + timeout {puts "TESTING ERROR 5.1\n";exit} "Child process initialized" } sleep 1 -send -- "file auto2\r" +send -- "ls auto3; pwd\r" expect { - timeout {puts "TESTING ERROR 4\n";exit} - "symbolic link to" + timeout {puts "TESTING ERROR 6\n";exit} + "cannot open directory" {puts "TESTING ERROR 6.1\n";exit} + "home" } send -- "exit\r" sleep 1 +# do not blacklist /usr/bin +send -- "firejail --blacklist=auto3\r" +expect { + timeout {puts "TESTING ERROR 7\n";exit} + "auto3 directory link was not blacklisted" +} +expect { + timeout {puts "TESTING ERROR 7.1\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ls auto3; pwd\r" +expect { + timeout {puts "TESTING ERROR 8\n";exit} + "cannot open directory" {puts "TESTING ERROR 9.1\n";exit} + "home" +} +send -- "exit\r" +sleep 1 puts "all done\n" diff --git a/test/test.sh b/test/test.sh index 8c6be8ddd..8d49468b3 100755 --- a/test/test.sh +++ b/test/test.sh @@ -16,9 +16,13 @@ echo "TESTING: blacklist" rm -fr dir\ with\ space ln -s auto auto2 +ln -s /bin auto3 +ln -s /usr/bin auto4 echo "TESTING: blacklist directory link" ./blacklist-link.exp rm -fr auto2 +rm -fr auto3 +rm -fr auto4 echo "TESTING: version" -- cgit v1.2.3-54-g00ecf