X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fdbus-manager.c;h=6abd5993706726f84c91d804c75c99fda212d08f;hb=f069efb4710332139ac508180cb8246b02428c17;hp=b7978e67005047b5f4eb3398c7059e37618d6102;hpb=556089dc57b10a12a03edd3d3e90ca17398ad206;p=elogind.git diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index b7978e670..6abd59937 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -547,7 +547,7 @@ static int method_start_transient_unit(sd_bus *bus, sd_bus_message *message, voi return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid unit type."); if (!unit_vtable[t]->can_transient) - return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Unit type %s does not support transient units."); + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Unit type %s does not support transient units.", unit_type_to_string(t)); mode = job_mode_from_string(smode); if (mode < 0) @@ -1405,6 +1405,9 @@ static int method_enable_unit_files_generic( sd_bus_error *error) { _cleanup_strv_free_ char **l = NULL; +#ifdef HAVE_SELINUX + char **i; +#endif UnitFileChange *changes = NULL; unsigned n_changes = 0; UnitFileScope scope; @@ -1414,14 +1417,23 @@ static int method_enable_unit_files_generic( assert(message); assert(m); - r = selinux_access_check(bus, message, verb, error); - if (r < 0) - return r; - r = sd_bus_message_read_strv(message, &l); if (r < 0) return r; +#ifdef HAVE_SELINUX + STRV_FOREACH(i, l) { + Unit *u; + + u = manager_get_unit(m, *i); + if (u) { + r = selinux_unit_access_check(u, bus, message, verb, error); + if (r < 0) + return r; + } + } +#endif + r = sd_bus_message_read(message, "bb", &runtime, &force); if (r < 0) return r;