summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-08-30 13:14:31 -0400
committerGitHub <noreply@github.com>2021-08-30 13:14:31 -0400
commit4834b7311903c6e80f0d05f5acb2889789685564 (patch)
treed5e096444517ee1e1e2b801f4d6385d46c1beaf7
parenta2acd04447a66027dc02a210d2961fcde6868985 (diff)
parent06f94dd09e52f89736012fafb65adb3774d795f6 (diff)
downloadpodman-4834b7311903c6e80f0d05f5acb2889789685564.tar.gz
podman-4834b7311903c6e80f0d05f5acb2889789685564.tar.bz2
podman-4834b7311903c6e80f0d05f5acb2889789685564.zip
Merge pull request #11360 from Luap99/rootless-resolv
rootless cni: resolve absolute symlinks correctly
-rw-r--r--libpod/networking_linux.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go
index 5ade0849d..9aa6cab15 100644
--- a/libpod/networking_linux.go
+++ b/libpod/networking_linux.go
@@ -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
}