]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
chase-symlinks: don't insist on absolute paths if CHASE_PREFIX_ROOT is set
authorLennart Poettering <lennart@poettering.net>
Sat, 17 Sep 2022 17:53:19 +0000 (19:53 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 20 Sep 2022 11:52:01 +0000 (13:52 +0200)
There's little reason to require this, given that we can just say that
if a relative path is specified it is to be read relative to the root.

This fixes a bootctl bug introduced by
3730dc5d5b4b7c4e1e7d0957c88568cc45de2390 which didn't bother prefixing
paths as necessary.

src/basic/chase-symlinks.c

index e889b22f47207554cf94fdea291a4378e2ab69e6..ad1c92900b605b7a4aacf56f61dee05c88978690 100644 (file)
@@ -84,10 +84,6 @@ int chase_symlinks(
         if (isempty(path))
                 return -EINVAL;
 
-        /* We don't support relative paths in combination with a root directory */
-        if (FLAGS_SET(flags, CHASE_PREFIX_ROOT) && !path_is_absolute(path))
-                return -EINVAL;
-
         /* This is a lot like canonicalize_file_name(), but takes an additional "root" parameter, that allows following
          * symlinks relative to a root directory, instead of the root of the host.
          *