summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-02-04 20:50:44 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-02-07 21:31:59 -0500
commit5be5d39bf0cda1026138bb6d7f43c03bb1f9e5cf (patch)
treeb29520ebc4d5e42fb9dceeaf6ff78be943a8f52b /src
parent957787821008f5823804c928c9cdc77bb3910027 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/core/load-dropin.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/load-dropin.c b/src/core/load-dropin.c
index 0511fb38ef..a43b6540ff 100644
--- a/src/core/load-dropin.c
+++ b/src/core/load-dropin.c
@@ -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",