From f3daf32c73656c5baa93acdca323295c61113cc3 Mon Sep 17 00:00:00 2001 From: Ben Foster Date: Thu, 20 Jul 2023 16:59:44 -0400 Subject: [PATCH] Fix ro mount option being passed "ro" was not parsed out of the string, so it was passed as part of data to mount(). This would lead to mount() returning an invalid argument code. Separate out the "ro" option, much like "userxattr", which will allow the MS-RDONLY mountflag to get set. Signed-off-by: Ben Foster --- snapshots/overlay/overlayutils/check.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snapshots/overlay/overlayutils/check.go b/snapshots/overlay/overlayutils/check.go index d2ac91aa8..726c085a9 100644 --- a/snapshots/overlay/overlayutils/check.go +++ b/snapshots/overlay/overlayutils/check.go @@ -175,7 +175,8 @@ func NeedsUserXAttr(d string) (bool, error) { } opts := []string{ - fmt.Sprintf("ro,lowerdir=%s:%s,upperdir=%s,workdir=%s", filepath.Join(td, "lower2"), filepath.Join(td, "lower1"), filepath.Join(td, "upper"), filepath.Join(td, "work")), + "ro", + fmt.Sprintf("lowerdir=%s:%s,upperdir=%s,workdir=%s", filepath.Join(td, "lower2"), filepath.Join(td, "lower1"), filepath.Join(td, "upper"), filepath.Join(td, "work")), "userxattr", }