From: Daniel Golle Date: Thu, 16 Jul 2020 12:14:51 +0000 (+0100) Subject: jail: fix some more mount options X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;ds=sidebyside;h=bfce7d128d9121d566de1beae52e699b6e1192c8;p=project%2Fprocd.git jail: fix some more mount options Make sure 'rbind' works as expected and add support for 'iversion' and 'noiversion' options. Signed-off-by: Daniel Golle --- diff --git a/jail/fs.c b/jail/fs.c index da6f588..352fa0d 100644 --- a/jail/fs.c +++ b/jail/fs.c @@ -104,7 +104,7 @@ static int do_mount(const char *root, const char *source, const char *target, co } if (mountflags & MS_BIND) { - if (mount(source, new, filesystemtype, MS_BIND, optstr)) { + if (mount(source, new, filesystemtype, MS_BIND | (mountflags & MS_REC), optstr)) { ERROR("failed to mount -B %s %s: %m\n", source, new); return error; } @@ -217,6 +217,10 @@ static int parseOCImountopts(struct blob_attr *msg, unsigned long *mount_flags, mf &= ~MS_NODEV; else if (!strcmp("nodev", tmp)) mf |= MS_NODEV; + else if (!strcmp("iversion", tmp)) + mf |= MS_I_VERSION; + else if (!strcmp("noiversion", tmp)) + mf &= ~MS_I_VERSION; else if (!strcmp("diratime", tmp)) mf &= ~MS_NODIRATIME; else if (!strcmp("nodiratime", tmp))