Skip to content

Commit 2be56b4

Browse files
committed
Fix regression with mounts with non-absolute source path
PR #1753 introduced a test on the mount flags but the binary operator was wrong, see opencontainers/runc#1753 (comment) This was noticed when investigating opencontainers/runtime-tools#651 Symptoms: in the container, /proc/self/mountinfo displays some mounts as follow: 296 279 0:67 / /tmp rw,nosuid - tmpfs /home/dpark/go/src/github.com/opencontainers/runc/tmpfs rw,size=65536k,mode=755 Signed-off-by: Alban Crequy <[email protected]>
1 parent bc8fdc1 commit 2be56b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libcontainer/specconv/spec_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func createLibcontainerMount(cwd string, m specs.Mount) *configs.Mount {
270270
flags, pgflags, data, ext := parseMountOptions(m.Options)
271271
source := m.Source
272272
device := m.Type
273-
if flags|unix.MS_BIND != 0 {
273+
if flags&unix.MS_BIND != 0 {
274274
if device == "" {
275275
device = "bind"
276276
}

0 commit comments

Comments
 (0)