From ccb5f36da044a9034c38c4da4215222ad52f4648 Mon Sep 17 00:00:00 2001 From: smitsohu Date: Thu, 25 Oct 2018 23:09:54 +0200 Subject: fix: return with euid 0 --- src/firejail/fs.c | 12 +++++++++--- 1 file 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) { EUID_USER(); // get mount point of the directory int mountid = get_mount_id(dir); - if (mountid == 0) + if (mountid == 0) { + EUID_ROOT(); return; + } // build array with all mount points that need to get remounted char **arr = get_all_mounts(mountid, dir); assert(arr); @@ -541,8 +543,10 @@ static void fs_rdwr_rec(const char *dir) { EUID_USER(); // get mount point of the directory int mountid = get_mount_id(dir); - if (mountid == 0) + if (mountid == 0) { + EUID_ROOT(); return; + } // build array with all mount points that need to get remounted char **arr = get_all_mounts(mountid, dir); assert(arr); @@ -585,8 +589,10 @@ void fs_noexec_rec(const char *dir) { EUID_USER(); // get mount point of the directory int mountid = get_mount_id(dir); - if (mountid == 0) + if (mountid == 0) { + EUID_ROOT(); return; + } // build array with all mount points that need to get remounted char **arr = get_all_mounts(mountid, dir); assert(arr); -- cgit v1.2.3-70-g09d2