Skip to content

Commit e944298

Browse files
Merge pull request #1316 from hqhq/cleanup_dest
Small cleanup
2 parents a8d7eb7 + 45a8341 commit e944298

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libcontainer/rootfs_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string) error {
230230
// any previous mounts can invalidate the next mount's destination.
231231
// this can happen when a user specifies mounts within other mounts to cause breakouts or other
232232
// evil stuff to try to escape the container's rootfs.
233-
if dest, err = symlink.FollowSymlinkInScope(filepath.Join(rootfs, m.Destination), rootfs); err != nil {
233+
if dest, err = symlink.FollowSymlinkInScope(dest, rootfs); err != nil {
234234
return err
235235
}
236236
if err := checkMountDestination(rootfs, dest); err != nil {
@@ -318,7 +318,7 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string) error {
318318
// this can happen when a user specifies mounts within other mounts to cause breakouts or other
319319
// evil stuff to try to escape the container's rootfs.
320320
var err error
321-
if dest, err = symlink.FollowSymlinkInScope(filepath.Join(rootfs, m.Destination), rootfs); err != nil {
321+
if dest, err = symlink.FollowSymlinkInScope(dest, rootfs); err != nil {
322322
return err
323323
}
324324
if err := checkMountDestination(rootfs, dest); err != nil {

0 commit comments

Comments
 (0)