diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-08-30 13:14:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-30 13:14:31 -0400 |
commit | 4834b7311903c6e80f0d05f5acb2889789685564 (patch) | |
tree | d5e096444517ee1e1e2b801f4d6385d46c1beaf7 | |
parent | a2acd04447a66027dc02a210d2961fcde6868985 (diff) | |
parent | 06f94dd09e52f89736012fafb65adb3774d795f6 (diff) | |
download | podman-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.go | 8 |
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 } |