summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Golle2020-07-16 12:14:51 +0000
committerDaniel Golle2020-07-16 12:14:51 +0000
commitbfce7d128d9121d566de1beae52e699b6e1192c8 (patch)
tree8034587364f64150a11d5e3ce152a56738eb277a
parent86a5105c81d93da7f41ca71ea82f5a479990da62 (diff)
downloadprocd-bfce7d128d9121d566de1beae52e699b6e1192c8.tar.gz
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 <daniel@makrotopia.org>
-rw-r--r--jail/fs.c6
1 files changed, 5 insertions, 1 deletions
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))