From bfce7d128d9121d566de1beae52e699b6e1192c8 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 16 Jul 2020 13:14:51 +0100 Subject: [PATCH] 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 --- jail/fs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)) -- 2.30.2