From 2150dfc070b2775100ef3a19bf92e4dfedc515c1 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Thu, 23 Mar 2017 12:50:47 -0400 Subject: testing --- src/firejail/checkcfg.c | 12 ++++++++---- test/root/checkcfg.exp | 39 +++++++++++++++++++++++++++++++++++++++ test/root/firejail.config | 5 +++++ 3 files changed, 52 insertions(+), 4 deletions(-) diff --git a/src/firejail/checkcfg.c b/src/firejail/checkcfg.c index 67bcd996a..f76f83d85 100644 --- a/src/firejail/checkcfg.c +++ b/src/firejail/checkcfg.c @@ -291,6 +291,10 @@ int checkcfg(int val) { else if (strncmp(ptr, "quiet-by-default ", 17) == 0) { if (strcmp(ptr + 17, "yes") == 0) arg_quiet = 1; + else if (strcmp(ptr + 17, "no") == 0) + arg_quiet = 0; + else + goto errout; } // remount /proc and /sys else if (strncmp(ptr, "remount-proc-sys ", 17) == 0) { @@ -413,16 +417,16 @@ void print_compiletime_support(void) { #endif ); - printf("\t- networking support is %s\n", -#ifdef HAVE_NETWORK + printf("\t- git install support is %s\n", +#ifdef HAVE_GIT_INSTALL "enabled" #else "disabled" #endif ); - printf("\t- git install support is %s\n", -#ifdef HAVE_GIT_INSTALL + printf("\t- networking support is %s\n", +#ifdef HAVE_NETWORK "enabled" #else "disabled" diff --git a/test/root/checkcfg.exp b/test/root/checkcfg.exp index e1ec6cf79..5ec1c4e77 100755 --- a/test/root/checkcfg.exp +++ b/test/root/checkcfg.exp @@ -98,6 +98,45 @@ expect { "noroot feature is disabled in Firejail configuration file\r" } +# error exit +send -- "echo \"join no\" > /etc/firejail/firejail.config\r" +after 100 +send -- "echo \"cache-tmpfs no\" >> /etc/firejail/firejail.config\r" +after 100 +send -- "echo \"file-transfer no\" >> /etc/firejail/firejail.config\r" +after 100 +send -- "echo \"x11 no\" >> /etc/firejail/firejail.config\r" +after 100 +send -- "echo \"firejail-prompt yes\" >> /etc/firejail/firejail.config\r" +after 100 +send -- "echo \"follow-symlink-as-user yes\" >> /etc/firejail/firejail.config\r" +after 100 +send -- "echo \"follow-symlink-private-bin yes\" >> /etc/firejail/firejail.config\r" +after 100 +send -- "echo \"force-nonewprivs yes\" >> /etc/firejail/firejail.config\r" +after 100 +send -- "echo \"seccomp no\" >> /etc/firejail/firejail.config\r" +after 100 +send -- "echo \"restricted-network yes\" >> /etc/firejail/firejail.config\r" +after 100 +send -- "echo \"xephyr-window-title yes\" >> /etc/firejail/firejail.config\r" +after 100 +send -- "echo \"quiet-by-default yes\" >> /etc/firejail/firejail.config\r" +after 100 +send -- "echo \"chroot-desktop no\" >> /etc/firejail/firejail.config\r" +after 100 +send -- "echo \"private-bin-no-local yes\" >> /etc/firejail/firejail.config\r" +after 100 +send -- "echo \"disable-mnt yes\" >> /etc/firejail/firejail.config\r" +after 100 +send -- "echo \"blablabla\" >> /etc/firejail/firejail.config\r" +after 100 +send -- "firejail --noprofile --force\r" +expect { + timeout {puts "TESTING ERROR 10\n";exit} + "invalid line\r" +} + send -- "exit\r" after 100 diff --git a/test/root/firejail.config b/test/root/firejail.config index 71ff2f4e9..9b57f5126 100644 --- a/test/root/firejail.config +++ b/test/root/firejail.config @@ -1,8 +1,13 @@ bind yes chroot yes chroot-desktop yes +cache-tmpfs yes file-transfer yes +firejail-prompt no +follow-symlink-as-user no +follow-symlink-private-bin no force-nonewprivs no +join yes network yes overlayfs yes private-bin-no-local no -- cgit v1.2.3-70-g09d2