diff options
Diffstat (limited to 'src/firejail/fs.c')
-rw-r--r-- | src/firejail/fs.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/firejail/fs.c b/src/firejail/fs.c index 46124c482..6fe9d56aa 100644 --- a/src/firejail/fs.c +++ b/src/firejail/fs.c | |||
@@ -485,8 +485,10 @@ void fs_rdonly_rec(const char *dir) { | |||
485 | EUID_USER(); | 485 | EUID_USER(); |
486 | // get mount point of the directory | 486 | // get mount point of the directory |
487 | int mountid = get_mount_id(dir); | 487 | int mountid = get_mount_id(dir); |
488 | if (mountid == 0) | 488 | if (mountid == 0) { |
489 | EUID_ROOT(); | ||
489 | return; | 490 | return; |
491 | } | ||
490 | // build array with all mount points that need to get remounted | 492 | // build array with all mount points that need to get remounted |
491 | char **arr = get_all_mounts(mountid, dir); | 493 | char **arr = get_all_mounts(mountid, dir); |
492 | assert(arr); | 494 | assert(arr); |
@@ -541,8 +543,10 @@ static void fs_rdwr_rec(const char *dir) { | |||
541 | EUID_USER(); | 543 | EUID_USER(); |
542 | // get mount point of the directory | 544 | // get mount point of the directory |
543 | int mountid = get_mount_id(dir); | 545 | int mountid = get_mount_id(dir); |
544 | if (mountid == 0) | 546 | if (mountid == 0) { |
547 | EUID_ROOT(); | ||
545 | return; | 548 | return; |
549 | } | ||
546 | // build array with all mount points that need to get remounted | 550 | // build array with all mount points that need to get remounted |
547 | char **arr = get_all_mounts(mountid, dir); | 551 | char **arr = get_all_mounts(mountid, dir); |
548 | assert(arr); | 552 | assert(arr); |
@@ -585,8 +589,10 @@ void fs_noexec_rec(const char *dir) { | |||
585 | EUID_USER(); | 589 | EUID_USER(); |
586 | // get mount point of the directory | 590 | // get mount point of the directory |
587 | int mountid = get_mount_id(dir); | 591 | int mountid = get_mount_id(dir); |
588 | if (mountid == 0) | 592 | if (mountid == 0) { |
593 | EUID_ROOT(); | ||
589 | return; | 594 | return; |
595 | } | ||
590 | // build array with all mount points that need to get remounted | 596 | // build array with all mount points that need to get remounted |
591 | char **arr = get_all_mounts(mountid, dir); | 597 | char **arr = get_all_mounts(mountid, dir); |
592 | assert(arr); | 598 | assert(arr); |