Skip to content

Commit

Permalink
Fix regression with mounts with non-absolute source path
Browse files Browse the repository at this point in the history
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 <alban@kinvolk.io>
  • Loading branch information
alban committed Jul 18, 2018
1 parent bc8fdc1 commit 2be56b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcontainer/specconv/spec_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func createLibcontainerMount(cwd string, m specs.Mount) *configs.Mount {
flags, pgflags, data, ext := parseMountOptions(m.Options)
source := m.Source
device := m.Type
if flags|unix.MS_BIND != 0 {
if flags&unix.MS_BIND != 0 {
if device == "" {
device = "bind"
}
Expand Down

0 comments on commit 2be56b4

Please sign in to comment.