return -ENOMEM;
return sd_bus_reply_method_return(
- message, "soshsub",
+ message, "soshusub",
session->id,
path,
session->user->runtime_path,
fifo_fd,
+ (uint32_t) session->user->uid,
session->seat ? session->seat->id : "",
(uint32_t) session->vtnr,
true);
delayed =
m->inhibit_delay_max > 0 &&
- manager_is_inhibited(m, w, INHIBIT_DELAY, NULL, false, false, 0);
+ manager_is_inhibited(m, w, INHIBIT_DELAY, NULL, false, false, 0, NULL);
if (delayed)
/* Shutdown is delayed, keep in mind what we
return r;
multiple_sessions = r > 0;
- blocked = manager_is_inhibited(m, w, INHIBIT_BLOCK, NULL, false, true, uid);
+ blocked = manager_is_inhibited(m, w, INHIBIT_BLOCK, NULL, false, true, uid, NULL);
if (multiple_sessions) {
r = bus_verify_polkit_async(m->bus, &m->polkit_registry, message,
return r;
multiple_sessions = r > 0;
- blocked = manager_is_inhibited(m, w, INHIBIT_BLOCK, NULL, false, true, uid);
+ blocked = manager_is_inhibited(m, w, INHIBIT_BLOCK, NULL, false, true, uid, NULL);
if (multiple_sessions) {
r = bus_verify_polkit(m->bus, message, action_multiple_sessions, false, &challenge, error);
SD_BUS_METHOD("ListUsers", NULL, "a(uso)", method_list_users, 0),
SD_BUS_METHOD("ListSeats", NULL, "a(so)", method_list_seats, 0),
SD_BUS_METHOD("ListInhibitors", NULL, "a(ssssuu)", method_list_inhibitors, 0),
- SD_BUS_METHOD("CreateSession", "uussssussbssa(sv)", "soshsub", method_create_session, 0),
+ SD_BUS_METHOD("CreateSession", "uussssussbssa(sv)", "soshusub", method_create_session, 0),
SD_BUS_METHOD("ReleaseSession", "s", NULL, method_release_session, 0),
SD_BUS_METHOD("ActivateSession", "s", NULL, method_activate_session, 0),
SD_BUS_METHOD("ActivateSessionOnSeat", "ss", NULL, method_activate_session_on_seat, 0),
int manager_dispatch_delayed(Manager *manager) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
+ Inhibitor *offending = NULL;
int r;
assert(manager);
return 0;
/* Continue delay? */
- if (manager_is_inhibited(manager, manager->action_what, INHIBIT_DELAY, NULL, false, false, 0)) {
+ if (manager_is_inhibited(manager, manager->action_what, INHIBIT_DELAY, NULL, false, false, 0, &offending)) {
+ _cleanup_free_ char *comm = NULL, *u = NULL;
+
+ get_process_comm(offending->pid, &comm);
+ u = uid_to_name(offending->uid);
if (manager->action_timestamp + manager->inhibit_delay_max > now(CLOCK_MONOTONIC))
return 0;
- log_info("Delay lock is active but inhibitor timeout is reached.");
+ log_info("Delay lock is active (UID %lu/%s, PID %lu/%s) but inhibitor timeout is reached.",
+ (unsigned long) offending->uid, strna(u),
+ (unsigned long) offending->pid, strna(comm));
}
/* Actually do the operation */