Fix infinite recursion when resolving ldcache

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar 2023-05-30 11:03:36 +02:00
parent 39263ea365
commit a6b0f45d2c

View File

@ -293,6 +293,9 @@ func (c *ldcache) resolve(target string) (string, error) {
if err != nil { if err != nil {
return "", fmt.Errorf("failed to resolve symlink: %v", err) return "", fmt.Errorf("failed to resolve symlink: %v", err)
} }
if link == name {
return name, nil
}
// We return absolute paths for all targets // We return absolute paths for all targets
if !filepath.IsAbs(link) || strings.HasPrefix(link, ".") { if !filepath.IsAbs(link) || strings.HasPrefix(link, ".") {