Skip to content

Commit

Permalink
Merge pull request #2035 from cyphar/bindmount-types
Browse files Browse the repository at this point in the history
specconv: always set "type: bind" in case of MS_BIND
  • Loading branch information
Mrunal Patel authored May 7, 2019
2 parents a0ecf74 + 8296826 commit 2484581
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libcontainer/specconv/spec_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,10 @@ func createLibcontainerMount(cwd string, m specs.Mount) *configs.Mount {
source := m.Source
device := m.Type
if flags&unix.MS_BIND != 0 {
if device == "" {
device = "bind"
}
// Any "type" the user specified is meaningless (and ignored) for
// bind-mounts -- so we set it to "bind" because rootfs_linux.go
// (incorrectly) relies on this for some checks.
device = "bind"
if !filepath.IsAbs(source) {
source = filepath.Join(cwd, m.Source)
}
Expand Down

0 comments on commit 2484581

Please sign in to comment.