shared/install: also check for self-aliases during installation and ignore them

We had a check that was done in unit_file_resolve_symlink(). Let's move
the check to unit_validate_alias_symlink_or_warn(), which makes it available
to the code in install.c.

With this, unit_file_resolve_symlink() behaves almost the same. The warning
about "suspicious symlink" is done a bit later. I think this should be OK.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2022-03-29 16:17:56 +02:00
parent 99aad9a2b9
commit f663e6468f
3 changed files with 21 additions and 20 deletions
+2 -4
View File
@@ -328,8 +328,7 @@ test ! -h "$root/etc/systemd/system/services.target.wants/templ1@two.service"
test ! -e "$root/etc/systemd/system/link4.service"
cat >"$root/etc/systemd/system/link4.service" <<EOF
[Install]
# FIXME: self-alias should be ignored
# Alias=link4.service
Alias=link4.service
Alias=link4@.service
Alias=link4@inst.service
Alias=link4alias.service
@@ -372,8 +371,7 @@ test ! -h "$root/etc/systemd/system/link4alias2.service"
test ! -e "$root/etc/systemd/system/link5.service"
cat >"$root/etc/systemd/system/link5.service" <<EOF
[Install]
# FIXME: self-alias should be ignored
# Alias=link5.service
Alias=link5.service
Alias=link5alias.service
Alias=link5alias2.service
EOF