]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/shared/install.c
shared/install: when looking for symlinks in .wants/.requires, ignore symlink target
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 16 Mar 2022 16:37:58 +0000 (17:37 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 29 Mar 2022 14:17:56 +0000 (16:17 +0200)
commit466f6979c90aaee62c33723392cc49c6638a3f46
tree4d5617c4d8d324ae7ffafd669bff5a7fc6f788fa
parentd6c9411072901556176ac130f2ce71a33107aa93
shared/install: when looking for symlinks in .wants/.requires, ignore symlink target

We'd say that file is enabled indirectly if we had a symlink like:
  foo@.service ← bar.target.wants/foo@one.service
but not when we had
  foo@one.service ← bar.target.wants/foo@one.service

The effect of both link types is the same. In fact we don't care
about the symlink target. (We'll warn if it is mismatched, but we honour
it anyway.)

So let's use the original match logic only for aliases.
For .wants/.requires we instead look for a matching source name,
or a source name that matches after stripping of instance.
src/shared/install.c