From a72ecf8ce0efd38d9cd6df218d352817c4734426 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Thu, 8 Sep 2016 09:35:41 -0400 Subject: 0.9.42 testing - CentOS 6 --- src/firejail/appimage.c | 11 +++++++++-- src/firejail/checkcfg.c | 12 ++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/firejail/appimage.c b/src/firejail/appimage.c index eb90a39dd..05bd8a1d8 100644 --- a/src/firejail/appimage.c +++ b/src/firejail/appimage.c @@ -40,6 +40,7 @@ void appimage_set(const char *appimage_path) { assert(devloop == NULL); // don't call this twice! EUID_ASSERT(); +#ifdef LOOP_CTL_GET_FREE // test for older kernels; this definition is found in /usr/include/linux/loop.h // check appimage_path if (access(appimage_path, R_OK) == -1) { fprintf(stderr, "Error: cannot access AppImage file\n"); @@ -48,8 +49,10 @@ void appimage_set(const char *appimage_path) { // open as user to prevent race condition int ffd = open(appimage_path, O_RDONLY|O_CLOEXEC); - if (ffd == -1) - errExit("open"); + if (ffd == -1) { + fprintf(stderr, "Error: /dev/loop-control interface is not supported by your kernel\n"); + exit(1); + } EUID_ROOT(); @@ -109,6 +112,10 @@ void appimage_set(const char *appimage_path) { errExit("asprintf"); free(mode); +#else + fprintf(stderr, "Error: /dev/loop-control interface is not supported by your kernel\n"); + exit(1); +#endif } void appimage_clear(void) { diff --git a/src/firejail/checkcfg.c b/src/firejail/checkcfg.c index 99266c575..34078492e 100644 --- a/src/firejail/checkcfg.c +++ b/src/firejail/checkcfg.c @@ -19,6 +19,7 @@ */ #include "firejail.h" #include +#include #define MAX_READ 8192 // line buffer for profile files @@ -286,6 +287,17 @@ void print_compiletime_support(void) { #endif ); + printf("\t- AppImage support is %s\n", +#ifdef LOOP_CTL_GET_FREE // test for older kernels; this definition is found in /usr/include/linux/loop.h + "enabled" +#else + "disabled" +#endif + ); + + + + printf("\t- bind support is %s\n", #ifdef HAVE_BIND -- cgit v1.2.3-70-g09d2