Skip to content

Commit

Permalink
Fixes 5370 infinite/maxLoopCount loop for relative symlinks
Browse files Browse the repository at this point in the history
use path.IsAbs() instead of checking if first char is '/'

Docker-DCO-1.1-Signed-off-by: Lajos Papp <[email protected]> (github: lalyos)
  • Loading branch information
lalyos committed May 15, 2014
1 parent b51c366 commit ad35d52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ Kimbro Staken <[email protected]>
Kiran Gangadharan <[email protected]>
Konstantin Pelykh <[email protected]>
Kyle Conroy <[email protected]>
Lajos Papp <[email protected]>
Laurie Voss <[email protected]>
Liang-Chi Hsieh <[email protected]>
Lokesh Mandvekar <[email protected]>
Expand Down
5 changes: 2 additions & 3 deletions pkg/symlink/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@ func FollowSymlinkInScope(link, root string) (string, error) {
return "", err
}

switch dest[0] {
case '/':
if path.IsAbs(dest) {
prev = filepath.Join(root, dest)
case '.':
} else {
prev, _ = filepath.Abs(prev)

if prev = filepath.Clean(filepath.Join(filepath.Dir(prev), dest)); len(prev) < len(root) {
Expand Down

0 comments on commit ad35d52

Please sign in to comment.