diff options
author | Anita Zhang <the.anitazha@gmail.com> | 2020-05-28 21:09:32 +0200 |
---|---|---|
committer | Anita Zhang <the.anitazha@gmail.com> | 2020-07-03 11:33:50 +0200 |
commit | 640f3b143d77b02612dc694a6a2be08f98d6c0e4 (patch) | |
tree | c757369a2e6088a31b78a3035d662ff1c308e850 /src/core | |
parent | NEWS: tweak WithoutRA= description a bit more (diff) | |
download | systemd-640f3b143d77b02612dc694a6a2be08f98d6c0e4.tar.xz systemd-640f3b143d77b02612dc694a6a2be08f98d6c0e4.zip |
core: check null_or_empty for masked units instead of /dev/null
There's some inconsistency in the what is considered a masked unit:
some places (i.e. load-fragment.c) use `null_or_empty()` while others
check if the file path is symlinked to "/dev/null". Since the latter
doesn't account for things like non-absolute symlinks to "/dev/null",
this commit switches the check for "/dev/null" to use `null_or_empty_path()`
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/unit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/unit.c b/src/core/unit.c index 18bf0cd52a..c739c0a561 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -5955,7 +5955,7 @@ const char *unit_label_path(const Unit *u) { return NULL; /* If a unit is masked, then don't read the SELinux label of /dev/null, as that really makes no sense */ - if (path_equal(p, "/dev/null")) + if (null_or_empty_path(p) > 0) return NULL; return p; |