X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fdbus-unit.c;h=8fe83aefec62fdf9a7ca53e6616a6ccfa4535f39;hb=ac45dec934b0932d03fbd498a3c6e8e90a01813f;hp=8f23fe76ce6a807a0844f4517ad8f6fcfa12fe6b;hpb=4f4f70361a64957c45a2d8f40bfb04c77b454697;p=elogind.git diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c index 8f23fe76c..8fe83aefe 100644 --- a/src/core/dbus-unit.c +++ b/src/core/dbus-unit.c @@ -421,6 +421,12 @@ int bus_unit_method_kill(sd_bus *bus, sd_bus_message *message, void *userdata, s assert(message); assert(u); + r = bus_verify_manage_unit_async_for_kill(u->manager, message, error); + if (r < 0) + return r; + if (r == 0) + return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */ + r = sd_bus_message_read(message, "si", &swho, &signo); if (r < 0) return r; @@ -455,6 +461,12 @@ int bus_unit_method_reset_failed(sd_bus *bus, sd_bus_message *message, void *use assert(message); assert(u); + r = bus_verify_manage_unit_async(u->manager, message, error); + if (r < 0) + return r; + if (r == 0) + return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */ + r = selinux_unit_access_check(u, message, "reload", error); if (r < 0) return r; @@ -472,6 +484,12 @@ int bus_unit_method_set_properties(sd_bus *bus, sd_bus_message *message, void *u assert(message); assert(u); + r = bus_verify_manage_unit_async(u->manager, message, error); + if (r < 0) + return r; + if (r == 0) + return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */ + r = sd_bus_message_read(message, "b", &runtime); if (r < 0) return r; @@ -758,13 +776,13 @@ int bus_unit_queue_job( return r; if (bus == u->manager->api_bus) { - if (!j->subscribed) { - r = sd_bus_track_new(bus, &j->subscribed, NULL, NULL); + if (!j->clients) { + r = sd_bus_track_new(bus, &j->clients, NULL, NULL); if (r < 0) return r; } - r = sd_bus_track_add_sender(j->subscribed, message); + r = sd_bus_track_add_sender(j->clients, message); if (r < 0) return r; }