1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-06 13:17:44 +03:00

Merge pull request #14596 from poettering/no-mask-perpetual

core: don't allow perpetual units to be masked
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2020-01-18 10:17:10 +01:00 committed by GitHub
commit 8a9125cbb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

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;

View File

@ -537,10 +537,9 @@ static int mount_verify(Mount *m) {
}
p = get_mount_parameters_fragment(m);
if (p && !p->what) {
log_unit_error(UNIT(m), "What= setting is missing. Refusing.");
return -ENOEXEC;
}
if (p && !p->what && !UNIT(m)->perpetual)
return log_unit_error_errno(UNIT(m), SYNTHETIC_ERRNO(ENOEXEC),
"What= setting is missing. Refusing.");
if (m->exec_context.pam_name && m->kill_context.kill_mode != KILL_CONTROL_GROUP) {
log_unit_error(UNIT(m), "Unit has PAM enabled. Kill mode must be set to control-group'. Refusing.");