Skip to content

Commit f3daf32

Browse files
committed
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 <[email protected]>
1 parent 4d2c887 commit f3daf32

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

snapshots/overlay/overlayutils/check.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ func NeedsUserXAttr(d string) (bool, error) {
175175
}
176176

177177
opts := []string{
178-
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")),
178+
"ro",
179+
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")),
179180
"userxattr",
180181
}
181182

0 commit comments

Comments
 (0)