aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2020-03-16 22:25:16 +0100
committerLibravatar GitHub <noreply@github.com>2020-03-16 22:25:16 +0100
commit0d998240288475d99e5b5bba2320a63bdfc74369 (patch)
tree79302e53d5cd8e5eb71c77f0f5f831dc902c0335
parentprofile fixes (diff)
downloadfirejail-0d998240288475d99e5b5bba2320a63bdfc74369.tar.gz
firejail-0d998240288475d99e5b5bba2320a63bdfc74369.tar.zst
firejail-0d998240288475d99e5b5bba2320a63bdfc74369.zip
remount fix - #3280
-rw-r--r--src/firejail/fs.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/firejail/fs.c b/src/firejail/fs.c
index ed2cc86dc..b642329bf 100644
--- a/src/firejail/fs.c
+++ b/src/firejail/fs.c
@@ -479,7 +479,7 @@ static void fs_remount_simple(const char *path, OPERATION op) {
479 // open path without following symbolic links 479 // open path without following symbolic links
480 int fd = safe_fd(path, O_PATH|O_NOFOLLOW|O_CLOEXEC); 480 int fd = safe_fd(path, O_PATH|O_NOFOLLOW|O_CLOEXEC);
481 if (fd == -1) 481 if (fd == -1)
482 errExit("open"); 482 goto out;
483 // identify file owner 483 // identify file owner
484 struct stat s; 484 struct stat s;
485 if (fstat(fd, &s) == -1) { 485 if (fstat(fd, &s) == -1) {
@@ -487,9 +487,8 @@ static void fs_remount_simple(const char *path, OPERATION op) {
487 // mounted without 'allow_root' or 'allow_other' 487 // mounted without 'allow_root' or 'allow_other'
488 if (errno != EACCES) 488 if (errno != EACCES)
489 errExit("fstat"); 489 errExit("fstat");
490 fwarning("not remounting %s\n", path);
491 close(fd); 490 close(fd);
492 return; 491 goto out;
493 } 492 }
494 // get mount flags 493 // get mount flags
495 struct statvfs buf; 494 struct statvfs buf;
@@ -566,6 +565,10 @@ static void fs_remount_simple(const char *path, OPERATION op) {
566 fs_logger2(opstr[op], path); 565 fs_logger2(opstr[op], path);
567 free(proc); 566 free(proc);
568 close(fd); 567 close(fd);
568 return;
569
570out:
571 fwarning("not remounting %s\n", path);
569} 572}
570 573
571// remount recursively; requires a resolved path 574// remount recursively; requires a resolved path