Skip to content

Commit

Permalink
Merge pull request #11360 from Luap99/rootless-resolv
Browse files Browse the repository at this point in the history
rootless cni: resolve absolute symlinks correctly
  • Loading branch information
openshift-merge-robot authored Aug 30, 2021
2 parents a2acd04 + 06f94dd commit 4834b73
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libpod/networking_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,13 @@ func (r *RootlessCNI) Do(toRun func() error) error {
// if there is no symlink exit
break
}
resolvePath = filepath.Join(filepath.Dir(resolvePath), link)
if filepath.IsAbs(link) {
// link is as an absolute path
resolvePath = link
} else {
// link is as a relative, join it with the previous path
resolvePath = filepath.Join(filepath.Dir(resolvePath), link)
}
if strings.HasPrefix(resolvePath, "/run/") {
break
}
Expand Down

0 comments on commit 4834b73

Please sign in to comment.