shared/install: fix handling of a linked unit file

When we have a symlink that goes outside of our search path, we should just
ignore the target file name. But we were verifying it, and rejecting in
the case where a symlink was created manually.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2022-03-29 16:17:57 +02:00
parent 48ed75adab
commit 48eadb9d9b
2 changed files with 11 additions and 5 deletions
+3 -1
View File
@@ -1606,7 +1606,9 @@ static int install_info_traverse(
return -ELOOP;
}
r = install_info_follow(ctx, i, lp, flags, false);
r = install_info_follow(ctx, i, lp, flags,
/* If linked, don't look at the target name */
/* ignore_different_name= */ i->type == UNIT_FILE_TYPE_LINKED);
if (r == -EXDEV) {
_cleanup_free_ char *buffer = NULL;
const char *bn;