From: Christian Brauner Date: Tue, 3 Aug 2021 10:13:01 +0000 (+0200) Subject: conf: let parse_vfs_attr() handle legacy mount flags as well X-Git-Tag: lxc-5.0.0~124^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f43436cbefa3466986e2262d5ce6a270b1fd801;p=thirdparty%2Flxc.git conf: let parse_vfs_attr() handle legacy mount flags as well Signed-off-by: Christian Brauner --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 37104761e..969ae7609 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2185,12 +2185,14 @@ static int parse_vfs_attr(struct lxc_mount_options *opts, char *opt, size_t size if (strequal(mo->name, "rbind")) { opts->recursive = 1; opts->bind = 1; + opts->mnt_flags |= mo->legacy_flag; /* MS_BIND | MS_REC */ return 0; } /* This is a bind-mount. */ if (strequal(mo->name, "bind")) { opts->bind = 1; + opts->mnt_flags |= mo->legacy_flag; /* MS_BIND */ return 0; } @@ -2199,21 +2201,24 @@ static int parse_vfs_attr(struct lxc_mount_options *opts, char *opt, size_t size if (mo->clear) { opts->attr.attr_clr |= mo->flag; + opts->mnt_flags &= ~mo->legacy_flag; TRACE("Lowering %s", mo->name); } else { opts->attr.attr_set |= mo->flag; + opts->mnt_flags |= mo->legacy_flag; TRACE("Raising %s", mo->name); } return 0; } - for (struct mount_opt *mo = &mount_opt[0]; mo->name != NULL; mo++) { + for (struct mount_opt *mo = &propagation_opt[0]; mo->name != NULL; mo++) { if (!strnequal(opt, mo->name, strlen(mo->name))) continue; /* TODO: Handle recursive propagation requests. */ opts->attr.propagation = mo->flag; + opts->mnt_flags |= mo->legacy_flag; return 0; }