mirror of
https://github.com/systemd/systemd.git
synced 2025-01-20 18:04:03 +03:00
core: implement masking of .wants/.requires symlinks
Fixes #1169. Fixes #4830. Example log errors: Feb 04 22:13:28 systemd[1462]: foo.service: Wants dependency on empty_file.service is masked by /home/zbyszek/.config/systemd/user/foo.service.wants/empty_file.service, ignoring Feb 04 22:13:28 systemd[1462]: foo.service: Wants dependency on masked.service is masked by /home/zbyszek/.config/systemd/user/foo.service.wants/masked.service, ignoring
This commit is contained in:
parent
9577878210
commit
5be5d39bf0
@ -47,6 +47,13 @@ static int process_deps(Unit *u, UnitDependency dependency, const char *dir_suff
|
||||
|
||||
entry = basename(*p);
|
||||
|
||||
if (null_or_empty_path(*p) > 0) {
|
||||
/* an error usually means an invalid symlink, which is not a mask */
|
||||
log_unit_debug(u, "%s dependency on %s is masked by %s, ignoring.",
|
||||
unit_dependency_to_string(dependency), entry, *p);
|
||||
continue;
|
||||
}
|
||||
|
||||
r = is_symlink(*p);
|
||||
if (r < 0) {
|
||||
log_unit_warning_errno(u, r, "%s dropin %s unreadable, ignoring: %m",
|
||||
|
Loading…
x
Reference in New Issue
Block a user