From 8d36b8675c140f0ef2678171a2ae9d57149642be Mon Sep 17 00:00:00 2001 From: smitsohu Date: Sat, 25 Sep 2021 16:20:38 +0200 Subject: [PATCH] private-lib fixup don't try to read /usr/bin/firejail if private-bin removed it from the sandbox filesystem --- src/firejail/fs_lib.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/firejail/fs_lib.c b/src/firejail/fs_lib.c index 9d7a17cf306..848c186fa3d 100644 --- a/src/firejail/fs_lib.c +++ b/src/firejail/fs_lib.c @@ -195,6 +195,11 @@ void fslib_mount_libs(const char *full_path, unsigned user) { assert(full_path); // if library/executable does not exist or the user does not have read access to it // print a warning and exit the function. + if (access(full_path, F_OK)) { + if (arg_debug || arg_debug_private_lib) + printf("Cannot find %s, skipping...\n", full_path); + return; + } if (user && access(full_path, R_OK)) { if (arg_debug || arg_debug_private_lib) printf("Cannot read %s, skipping...\n", full_path);