diff options
author | Lantao Liu <lantaol@google.com> | 2018-06-12 13:54:02 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-06-12 13:54:54 -0700 |
commit | 2506b9b11f4e20bf4895f6eb59334ea5cb7d20e8 (patch) | |
tree | 89fccd3878556675c21b8d7f388f8c1e732aeb89 /runsc/boot/fs.go | |
parent | 711a9869e54743b05fc3478be5adce31d45cefe5 (diff) |
runsc: do not include sub target if it is not started with '/'.
PiperOrigin-RevId: 200274828
Change-Id: I956703217df08d8650a881479b7ade8f9f119912
Diffstat (limited to 'runsc/boot/fs.go')
-rw-r--r-- | runsc/boot/fs.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/runsc/boot/fs.go b/runsc/boot/fs.go index 28c3e8cd0..7243153f2 100644 --- a/runsc/boot/fs.go +++ b/runsc/boot/fs.go @@ -445,6 +445,9 @@ func addSubmountOverlay(ctx context.Context, inode *fs.Inode, submounts []string // children of the given root. The returned paths are relative to the root. func subtargets(root string, mnts []specs.Mount) []string { r := filepath.Clean(root) + if len(r) > 0 && r[len(r)-1] != '/' { + r += "/" + } var targets []string for _, mnt := range mnts { t := filepath.Clean(mnt.Destination) |