aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/firejail/fs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/firejail/fs.c b/src/firejail/fs.c
index b958df81a..9f0dac4e0 100644
--- a/src/firejail/fs.c
+++ b/src/firejail/fs.c
@@ -1379,6 +1379,16 @@ void fs_chroot(const char *rootdir) {
1379 ASSERT_PERMS(rundir, 0, 0, 0755); 1379 ASSERT_PERMS(rundir, 0, 0, 0755);
1380 free(rundir); 1380 free(rundir);
1381 1381
1382 // create /run/firejail/lib directory in chroot and mount it
1383 if (asprintf(&rundir, "%s%s", rootdir, RUN_FIREJAIL_LIB_DIR) == -1)
1384 errExit("asprintf");
1385 if (mkdir(rundir, 0755) == -1 && errno != EEXIST)
1386 errExit("mkdir");
1387 ASSERT_PERMS(rundir, 0, 0, 0755);
1388 if (mount(RUN_FIREJAIL_LIB_DIR, rundir, NULL, MS_BIND|MS_REC, NULL) < 0)
1389 errExit("mount bind");
1390 free(rundir);
1391
1382 // create /run/firejail/mnt directory in chroot and mount the current one 1392 // create /run/firejail/mnt directory in chroot and mount the current one
1383 if (asprintf(&rundir, "%s%s", rootdir, RUN_MNT_DIR) == -1) 1393 if (asprintf(&rundir, "%s%s", rootdir, RUN_MNT_DIR) == -1)
1384 errExit("asprintf"); 1394 errExit("asprintf");