]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: don't allow manual start with reload-or-restart too 1679/head
authorEvgeny Vereshchagin <evvers@ya.ru>
Mon, 26 Oct 2015 04:23:09 +0000 (04:23 +0000)
committerEvgeny Vereshchagin <evvers@ya.ru>
Mon, 26 Oct 2015 04:23:09 +0000 (04:23 +0000)
fix bug: systemctl reload-or-restart starts a service with RefuseManualStart=yes

src/core/dbus-unit.c

index b2b9eceeb3cf0561e9477ba52f5f3a42a8af6a5e..7220fe688f42e718d37187c9dcf8eb8d83969b15 100644 (file)
@@ -986,7 +986,8 @@ int bus_unit_queue_job(
 
         if ((type == JOB_START && u->refuse_manual_start) ||
             (type == JOB_STOP && u->refuse_manual_stop) ||
-            ((type == JOB_RESTART || type == JOB_TRY_RESTART) && (u->refuse_manual_start || u->refuse_manual_stop)))
+            ((type == JOB_RESTART || type == JOB_TRY_RESTART) && (u->refuse_manual_start || u->refuse_manual_stop)) ||
+            (type == JOB_RELOAD_OR_START && job_type_collapse(type, u) == JOB_START && u->refuse_manual_start))
                 return sd_bus_error_setf(error, BUS_ERROR_ONLY_BY_DEPENDENCY, "Operation refused, unit %s may be requested by dependency only.", u->id);
 
         r = manager_add_job(u->manager, type, u, mode, true, error, &j);