core: never allow perpetual units to be masked

Fixes: #14550
This commit is contained in:
Lennart Poettering 2020-01-17 15:02:13 +01:00
parent 1f0c7cd5e1
commit 88414eed6f

View File

@ -4703,7 +4703,9 @@ int unit_load_fragment(Unit *u) {
return r;
if (null_or_empty(&st)) {
u->load_state = UNIT_MASKED;
/* Unit file is masked */
u->load_state = u->perpetual ? UNIT_LOADED : UNIT_MASKED; /* don't allow perpetual units to ever be masked */
u->fragment_mtime = 0;
} else {
u->load_state = UNIT_LOADED;