From: Robert Swiecki Date: Sat, 7 Oct 2017 20:33:46 +0000 (+0200) Subject: cmdline: missing flags for --chroot mount point X-Git-Tag: 1.9~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5d4f42a7298b5887580a5b16938b475aeb268830;p=platform%2Fupstream%2Fnsjail.git cmdline: missing flags for --chroot mount point --- diff --git a/cmdline.c b/cmdline.c index 10f34db..c9e719a 100644 --- a/cmdline.c +++ b/cmdline.c @@ -757,7 +757,7 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf) if (nsjconf->mount_proc == true) { if (!mountAddMountPt(nsjconf, /* src= */ NULL, "/proc", "proc", "", - nsjconf->is_root_rw == false ? MS_RDONLY : 0, /* isDir= */ + nsjconf->is_root_rw ? 0 : MS_RDONLY, /* isDir= */ true, /* mandatory= */ true, NULL, NULL, NULL, 0, /* is_symlink= */ @@ -768,13 +768,14 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf) if (nsjconf->chroot != NULL) { if (!mountAddMountPt (nsjconf, nsjconf->chroot, "/", /* fs_type= */ "", /* options= */ "", - nsjconf->is_root_rw == false ? MS_RDONLY : 0, /* isDir= */ true, + nsjconf->is_root_rw ? (MS_BIND | MS_REC) : (MS_BIND | MS_REC | MS_RDONLY), + /* isDir= */ true, /* mandatory= */ true, NULL, NULL, NULL, 0, /* is_symlink= */ false)) { return false; } } else { if (!mountAddMountPt(nsjconf, /* src= */ NULL, "/", "tmpfs", /* options= */ "", - nsjconf->is_root_rw == false ? MS_RDONLY : 0, /* isDir= */ + nsjconf->is_root_rw ? 0 : MS_RDONLY, /* isDir= */ true, /* mandatory= */ true, NULL, NULL, NULL, 0, /* is_symlink= */