]> git.ipfire.org Git - thirdparty/lxc.git/commit
conf: fix read-only bind mounts 3323/head
authorTycho Andersen <tycho@tycho.ws>
Tue, 24 Mar 2020 16:16:50 +0000 (10:16 -0600)
committerTycho Andersen <tycho@tycho.ws>
Tue, 24 Mar 2020 16:20:44 +0000 (10:20 -0600)
commit94bef7e4b4ee4b8b05bc4ba52b536fdc8d099c2c
tree8246352bda8394beb7fbb92b3dd7e48c09f5f2a3
parente4e80aa9e9d07e849d48838531ff1db7eb22ab06
conf: fix read-only bind mounts

Here we would always set MS_RDONLY in required_flags if it was set in
mountflags, so the expression:

!(required_flags & ~mountflags)

would always be true, and we would always skip the remount.

Instead, let's treat readonly as special: always do the remount if
MS_RDONLY is present. Unfortunately it doesn't seem to show up in
sb.f_flag, so we can't use the same path as everything else.

This only inadvertently worked before because of a bug fixed in
f75917858023 ("conf: don't accidently double-mount").

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
src/lxc/conf.c