]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
chase-symlinks: Fix regression from 5bc244aaa90211ccd8370535274c266cdff6a1cb
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 30 Nov 2022 10:37:31 +0000 (11:37 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 5 Dec 2022 08:27:58 +0000 (09:27 +0100)
Previously, chase_symlinks() always returned an absolute path, which
changed after 5bc244aaa90211ccd8370535274c266cdff6a1cb. This commit
fixes chase_symlinks() so it returns absolute paths all the time again.

src/basic/chase-symlinks.c

index 0bb07000bad8922b10e83a4793cb6bd059997df0..fc6e26d2f206cab8b28d90da20eb22425e493ae5 100644 (file)
@@ -466,8 +466,10 @@ int chase_symlinks(
                         return -errno;
 
                 flags |= CHASE_AT_RESOLVE_IN_ROOT;
-        } else
+        } else {
+                path = absolute;
                 fd = AT_FDCWD;
+        }
 
         r = chase_symlinks_at(fd, path, flags & ~CHASE_PREFIX_ROOT, ret_path ? &p : NULL, ret_fd ? &pfd : NULL);
         if (r < 0)