From e35b345163cfd4e5f5f6f12be15035d9976027ba Mon Sep 17 00:00:00 2001 From: Jagger Date: Wed, 2 Mar 2016 02:30:30 +0100 Subject: [PATCH] Support for --chroot "" --- cmdline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmdline.c b/cmdline.c index cee7539..4a0530c 100644 --- a/cmdline.c +++ b/cmdline.c @@ -307,7 +307,7 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf) "\te: Immediately launch a single process on a console using execve [MODE_STANDALONE_EXECVE]\n" "\tr: Immediately launch a single process on a console, keep doing it forever [MODE_STANDALONE_RERUN]"}, {{"cmd", no_argument, NULL, 0x500}, "Equivalent of -Mo (MODE_STANDALONE_ONCE), run command on a local console, once"}, - {{"chroot", required_argument, NULL, 'c'}, "Directory containing / of the jail (default: \"/\")"}, + {{"chroot", required_argument, NULL, 'c'}, "Directory containing / of the jail (default: \"/\"). Skip mounting it if \"\""}, {{"rw", no_argument, NULL, 0x601}, "Mount / as RW (default: RO)"}, {{"user", required_argument, NULL, 'u'}, "Username/uid of processess inside the jail (default: your current uid). You can also use inside_ns_uid:outside_ns_uid convention here"}, {{"group", required_argument, NULL, 'g'}, "Groupname/gid of processess inside the jail (default: your current gid). You can also use inside_ns_gid:global_ns_gid convention here"}, @@ -589,7 +589,7 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf) p->fs_type = "proc"; TAILQ_INSERT_HEAD(&nsjconf->mountpts, p, pointers); } - { + if (strcmp(nsjconf->chroot, "") != 0) { struct mounts_t *p = utilMalloc(sizeof(struct mounts_t)); p->src = nsjconf->chroot; p->dst = "/"; -- 2.34.1