summaryrefslogtreecommitdiffstats
path: root/src/firejail/appimage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/firejail/appimage.c')
-rw-r--r--src/firejail/appimage.c11
1 files changed, 9 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) {
40 assert(devloop == NULL); // don't call this twice! 40 assert(devloop == NULL); // don't call this twice!
41 EUID_ASSERT(); 41 EUID_ASSERT();
42 42
43#ifdef LOOP_CTL_GET_FREE // test for older kernels; this definition is found in /usr/include/linux/loop.h
43 // check appimage_path 44 // check appimage_path
44 if (access(appimage_path, R_OK) == -1) { 45 if (access(appimage_path, R_OK) == -1) {
45 fprintf(stderr, "Error: cannot access AppImage file\n"); 46 fprintf(stderr, "Error: cannot access AppImage file\n");
@@ -48,8 +49,10 @@ void appimage_set(const char *appimage_path) {
48 49
49 // open as user to prevent race condition 50 // open as user to prevent race condition
50 int ffd = open(appimage_path, O_RDONLY|O_CLOEXEC); 51 int ffd = open(appimage_path, O_RDONLY|O_CLOEXEC);
51 if (ffd == -1) 52 if (ffd == -1) {
52 errExit("open"); 53 fprintf(stderr, "Error: /dev/loop-control interface is not supported by your kernel\n");
54 exit(1);
55 }
53 56
54 EUID_ROOT(); 57 EUID_ROOT();
55 58
@@ -109,6 +112,10 @@ void appimage_set(const char *appimage_path) {
109 errExit("asprintf"); 112 errExit("asprintf");
110 113
111 free(mode); 114 free(mode);
115#else
116 fprintf(stderr, "Error: /dev/loop-control interface is not supported by your kernel\n");
117 exit(1);
118#endif
112} 119}
113 120
114void appimage_clear(void) { 121void appimage_clear(void) {