From: Zbigniew Jędrzejewski-Szmek Date: Thu, 17 Mar 2022 15:02:10 +0000 (+0100) Subject: shared/install: fix handling of a linked unit file X-Git-Tag: v251-rc1~3^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=48eadb9d9b66f302cda09cdf6d35fead31aaa968;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/shared/install.c b/src/shared/install.c index 6aacdcf967c..20707edf58b 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -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; diff --git a/test/test-systemctl-enable.sh b/test/test-systemctl-enable.sh index 9463433c5ba..45f3513de3a 100644 --- a/test/test-systemctl-enable.sh +++ b/test/test-systemctl-enable.sh @@ -216,12 +216,16 @@ cat >"$root/link3.suffix" <