From: Lennart Poettering Date: Sat, 17 Sep 2022 17:53:19 +0000 (+0200) Subject: chase-symlinks: don't insist on absolute paths if CHASE_PREFIX_ROOT is set X-Git-Tag: v252-rc1~132^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d45dee7c0073d22943f367a35314396bb0b40168;p=thirdparty%2Fsystemd.git chase-symlinks: don't insist on absolute paths if CHASE_PREFIX_ROOT is set 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. --- diff --git a/src/basic/chase-symlinks.c b/src/basic/chase-symlinks.c index e889b22f472..ad1c92900b6 100644 --- a/src/basic/chase-symlinks.c +++ b/src/basic/chase-symlinks.c @@ -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. *