From 9c0730573aa6f5cf96278704a9a8c14457f1e010 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Mon, 8 Feb 2016 12:58:37 -0500 Subject: fixed whitelist problem --- test/test.sh | 3 +++ test/whitelist-empty.exp | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100755 test/whitelist-empty.exp (limited to 'test') diff --git a/test/test.sh b/test/test.sh index 6273c0a1b..ca7152b55 100755 --- a/test/test.sh +++ b/test/test.sh @@ -15,6 +15,9 @@ echo "TESTING: invalid filename" echo "TESTING: environment variables" ./env.exp +echo "TESTING: whitelist empty" +./whitelist-empty.exp + echo "TESTING: ignore command" ./ignore.exp diff --git a/test/whitelist-empty.exp b/test/whitelist-empty.exp new file mode 100755 index 000000000..226b019db --- /dev/null +++ b/test/whitelist-empty.exp @@ -0,0 +1,50 @@ +#!/usr/bin/expect -f + +set timeout 30 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail --whitelist=~/blablabla --whitelist=/tmp/blablabla --whitelist=/media/blablabla --whitelist=/var/blablabla --whitelist=/dev/blablabla --whitelist=/opt/blablabla\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ls -l ~/ | wc -l\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "0" +} + +send -- "ls -l /tmp | wc -l\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "0" +} + +send -- "ls -l /media | wc -l\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "0" +} + +send -- "ls -l /var | wc -l\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "0" +} + +send -- "ls -l /dev | wc -l\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "0" +} +send -- "ls -l /opt | wc -l\r" +expect { + timeout {puts "TESTING ERROR 6\n";exit} + "0" +} + + +puts "\nall done\n" -- cgit v1.2.3-54-g00ecf