mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
specconv: handle recursive attribute clearing more consistently
If a user specifies a configuration like "rro, rrw", we should have
similar behaviour to "ro, rw" where we clear the previous flags so that
the last specified flag takes precendence.
Fixes: 382eba4354 ("Support recursive mount attrs ("rro", "rnosuid", "rnodev", ...)")
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
This commit is contained in:
@@ -1036,8 +1036,10 @@ func parseMountOptions(options []string) *configs.Mount {
|
||||
} else if f, exists := recAttrFlags[o]; exists {
|
||||
if f.clear {
|
||||
recAttrClr |= f.flag
|
||||
recAttrSet &= ^f.flag
|
||||
} else {
|
||||
recAttrSet |= f.flag
|
||||
recAttrClr &= ^f.flag
|
||||
if f.flag&unix.MOUNT_ATTR__ATIME == f.flag {
|
||||
// https://man7.org/linux/man-pages/man2/mount_setattr.2.html
|
||||
// "cannot simply specify the access-time setting in attr_set, but must also include MOUNT_ATTR__ATIME in the attr_clr field."
|
||||
|
||||
Reference in New Issue
Block a user