diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-04-29 13:13:51 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-04-29 13:13:51 -0700 |
commit | d5c34ba2ffef0b0aee38d4f96f06bc00b04b0a53 (patch) | |
tree | 8dd5bb4876c81d7f0ce44eb1e1c3e35b7ceec1b9 /runsc/specutils | |
parent | ce19497c1c0829af6ba56f0cc68e3a4cb33cf1c8 (diff) | |
parent | fc53d6436776d5de052075e98f44417f04ced7e7 (diff) |
Merge pull request #2487 from moricho:fix/bindmount
PiperOrigin-RevId: 309082540
Diffstat (limited to 'runsc/specutils')
-rw-r--r-- | runsc/specutils/specutils.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/runsc/specutils/specutils.go b/runsc/specutils/specutils.go index 837d5e238..202518b58 100644 --- a/runsc/specutils/specutils.go +++ b/runsc/specutils/specutils.go @@ -311,7 +311,19 @@ func capsFromNames(names []string, skipSet map[linux.Capability]struct{}) (auth. // Is9PMount returns true if the given mount can be mounted as an external gofer. func Is9PMount(m specs.Mount) bool { - return m.Type == "bind" && m.Source != "" && IsSupportedDevMount(m) + var isBind bool + switch m.Type { + case "bind": + isBind = true + default: + for _, opt := range m.Options { + if opt == "bind" || opt == "rbind" { + isBind = true + break + } + } + } + return isBind && m.Source != "" && IsSupportedDevMount(m) } // IsSupportedDevMount returns true if the mount is a supported /dev mount. |