aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/firejail/fs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/firejail/fs.c b/src/firejail/fs.c
index 1f0ccac1a..7b5200d1c 100644
--- a/src/firejail/fs.c
+++ b/src/firejail/fs.c
@@ -535,6 +535,14 @@ void fs_remount(const char *dir, OPERATION op, unsigned check_mnt) {
535 535
536void fs_remount_rec(const char *dir, OPERATION op, unsigned check_mnt) { 536void fs_remount_rec(const char *dir, OPERATION op, unsigned check_mnt) {
537 assert(dir); 537 assert(dir);
538 struct stat s;
539 if (stat(dir, &s) != 0)
540 return;
541 if (!S_ISDIR(s.st_mode)) {
542 // no need to search in /proc/self/mountinfo for submounts if not a directory
543 fs_remount(dir, op, check_mnt);
544 return;
545 }
538 // get mount point of the directory 546 // get mount point of the directory
539 int mountid = get_mount_id(dir); 547 int mountid = get_mount_id(dir);
540 if (mountid == -1) 548 if (mountid == -1)