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
3730dc5d5b which didn't bother prefixing
paths as necessary.
This commit is contained in:
Lennart Poettering
2022-09-17 19:53:19 +02:00
parent 13879c54d4
commit d45dee7c00

View 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.
*