From 6078d6b63fb14eca3ada76cf2cf449920b5b0618 Mon Sep 17 00:00:00 2001 From: Ruben Jenster Date: Tue, 22 Jun 2021 10:27:10 +0200 Subject: [PATCH] fix mount option parsing Do not append the propgation options to the mount data. Filesystems fail to mount if the mount data contains propagation options. See also https://github.com/lxc/lxcri/issues/30 Signed-off-by: Ruben Jenster --- src/lxc/conf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index a7775059df..2a66c232a9 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2217,6 +2217,12 @@ static int parse_mntopt(char *opt, unsigned long *flags, char **data, size_t siz { size_t ret; + /* Propagation opts are parsed separately and must not go into data. */ + for (struct mount_opt *mo = &propagation_opt[0]; mo->name != NULL; mo++) { + if (strnequal(opt, mo->name, strlen(mo->name))) + return 0; + } + /* If '=' is contained in opt, the option must go into data. */ if (!strchr(opt, '=')) { /*