From: Lennart Poettering Date: Thu, 7 Apr 2011 16:47:35 +0000 (+0200) Subject: unit: disallow configuration of more than one on_failure dependencies if OnFailureIso... X-Git-Tag: v25~80 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=f68319bbb8e95e6afa5793834668b5c094616249 unit: disallow configuration of more than one on_failure dependencies if OnFailureIsolate= is on --- diff --git a/src/unit.c b/src/unit.c index e5a962352..32071f217 100644 --- a/src/unit.c +++ b/src/unit.c @@ -814,6 +814,16 @@ int unit_load(Unit *u) { if ((r = unit_add_default_dependencies(u)) < 0) goto fail; + if (u->meta.on_failure_isolate && + set_size(u->meta.dependencies[UNIT_ON_FAILURE]) > 1) { + + log_error("More than one OnFailure= dependencies specified for %s but OnFailureIsolate= enabled. Refusing.", + u->meta.id); + + r = -EINVAL; + goto fail; + } + assert((u->meta.load_state != UNIT_MERGED) == !u->meta.merged_into); unit_add_to_dbus_queue(unit_follow_merge(u));