1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 #include "alloc-util.h"
6 #include "bus-common-errors.h"
10 #include "logind-brightness.h"
11 #include "logind-dbus.h"
12 #include "logind-seat-dbus.h"
13 #include "logind-session-dbus.h"
14 #include "logind-session-device.h"
15 #include "logind-session.h"
16 #include "logind-user-dbus.h"
18 #include "missing_capability.h"
19 #include "path-util.h"
20 #include "signal-util.h"
21 #include "stat-util.h"
23 #include "user-util.h"
26 static int property_get_user(
29 const char *interface
,
31 sd_bus_message
*reply
,
33 sd_bus_error
*error
) {
35 _cleanup_free_
char *p
= NULL
;
36 Session
*s
= userdata
;
42 p
= user_bus_path(s
->user
);
46 return sd_bus_message_append(reply
, "(uo)", (uint32_t) s
->user
->user_record
->uid
, p
);
49 static int property_get_name(
52 const char *interface
,
54 sd_bus_message
*reply
,
56 sd_bus_error
*error
) {
58 Session
*s
= userdata
;
64 return sd_bus_message_append(reply
, "s", s
->user
->user_record
->user_name
);
67 static int property_get_seat(
70 const char *interface
,
72 sd_bus_message
*reply
,
74 sd_bus_error
*error
) {
76 _cleanup_free_
char *p
= NULL
;
77 Session
*s
= userdata
;
83 p
= s
->seat
? seat_bus_path(s
->seat
) : strdup("/");
87 return sd_bus_message_append(reply
, "(so)", s
->seat
? s
->seat
->id
: "", p
);
90 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_type
, session_type
, SessionType
);
91 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_class
, session_class
, SessionClass
);
92 static BUS_DEFINE_PROPERTY_GET(property_get_active
, "b", Session
, session_is_active
);
93 static BUS_DEFINE_PROPERTY_GET2(property_get_state
, "s", Session
, session_get_state
, session_state_to_string
);
95 static int property_get_idle_hint(
98 const char *interface
,
100 sd_bus_message
*reply
,
102 sd_bus_error
*error
) {
104 Session
*s
= userdata
;
110 return sd_bus_message_append(reply
, "b", session_get_idle_hint(s
, NULL
) > 0);
113 static int property_get_idle_since_hint(
116 const char *interface
,
117 const char *property
,
118 sd_bus_message
*reply
,
120 sd_bus_error
*error
) {
122 Session
*s
= userdata
;
123 dual_timestamp t
= DUAL_TIMESTAMP_NULL
;
131 r
= session_get_idle_hint(s
, &t
);
135 u
= streq(property
, "IdleSinceHint") ? t
.realtime
: t
.monotonic
;
137 return sd_bus_message_append(reply
, "t", u
);
140 static int property_get_locked_hint(
143 const char *interface
,
144 const char *property
,
145 sd_bus_message
*reply
,
147 sd_bus_error
*error
) {
149 Session
*s
= userdata
;
155 return sd_bus_message_append(reply
, "b", session_get_locked_hint(s
) > 0);
158 int bus_session_method_terminate(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
159 Session
*s
= userdata
;
165 r
= bus_verify_polkit_async(
168 "org.freedesktop.login1.manage",
171 s
->user
->user_record
->uid
,
172 &s
->manager
->polkit_registry
,
177 return 1; /* Will call us back */
179 r
= session_stop(s
, true);
183 return sd_bus_reply_method_return(message
, NULL
);
186 int bus_session_method_activate(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
187 Session
*s
= userdata
;
193 r
= session_activate(s
);
197 return sd_bus_reply_method_return(message
, NULL
);
200 int bus_session_method_lock(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
201 Session
*s
= userdata
;
207 r
= bus_verify_polkit_async(
210 "org.freedesktop.login1.lock-sessions",
213 s
->user
->user_record
->uid
,
214 &s
->manager
->polkit_registry
,
219 return 1; /* Will call us back */
221 r
= session_send_lock(s
, strstr(sd_bus_message_get_member(message
), "Lock"));
225 return sd_bus_reply_method_return(message
, NULL
);
228 static int method_set_idle_hint(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
229 _cleanup_(sd_bus_creds_unrefp
) sd_bus_creds
*creds
= NULL
;
230 Session
*s
= userdata
;
237 r
= sd_bus_message_read(message
, "b", &b
);
241 r
= sd_bus_query_sender_creds(message
, SD_BUS_CREDS_EUID
, &creds
);
245 r
= sd_bus_creds_get_euid(creds
, &uid
);
249 if (uid
!= 0 && uid
!= s
->user
->user_record
->uid
)
250 return sd_bus_error_setf(error
, SD_BUS_ERROR_ACCESS_DENIED
, "Only owner of session may set idle hint");
252 r
= session_set_idle_hint(s
, b
);
254 return sd_bus_error_setf(error
, SD_BUS_ERROR_NOT_SUPPORTED
, "Idle hint control is not supported on non-graphical sessions.");
258 return sd_bus_reply_method_return(message
, NULL
);
261 static int method_set_locked_hint(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
262 _cleanup_(sd_bus_creds_unrefp
) sd_bus_creds
*creds
= NULL
;
263 Session
*s
= userdata
;
270 r
= sd_bus_message_read(message
, "b", &b
);
274 r
= sd_bus_query_sender_creds(message
, SD_BUS_CREDS_EUID
, &creds
);
278 r
= sd_bus_creds_get_euid(creds
, &uid
);
282 if (uid
!= 0 && uid
!= s
->user
->user_record
->uid
)
283 return sd_bus_error_setf(error
, SD_BUS_ERROR_ACCESS_DENIED
, "Only owner of session may set locked hint");
285 session_set_locked_hint(s
, b
);
287 return sd_bus_reply_method_return(message
, NULL
);
290 int bus_session_method_kill(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
291 Session
*s
= userdata
;
300 r
= sd_bus_message_read(message
, "si", &swho
, &signo
);
307 who
= kill_who_from_string(swho
);
309 return sd_bus_error_setf(error
, SD_BUS_ERROR_INVALID_ARGS
, "Invalid kill parameter '%s'", swho
);
312 if (!SIGNAL_VALID(signo
))
313 return sd_bus_error_setf(error
, SD_BUS_ERROR_INVALID_ARGS
, "Invalid signal %i", signo
);
315 r
= bus_verify_polkit_async(
318 "org.freedesktop.login1.manage",
321 s
->user
->user_record
->uid
,
322 &s
->manager
->polkit_registry
,
327 return 1; /* Will call us back */
329 r
= session_kill(s
, who
, signo
);
333 return sd_bus_reply_method_return(message
, NULL
);
336 static int method_take_control(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
337 _cleanup_(sd_bus_creds_unrefp
) sd_bus_creds
*creds
= NULL
;
338 Session
*s
= userdata
;
345 r
= sd_bus_message_read(message
, "b", &force
);
349 r
= sd_bus_query_sender_creds(message
, SD_BUS_CREDS_EUID
, &creds
);
353 r
= sd_bus_creds_get_euid(creds
, &uid
);
357 if (uid
!= 0 && (force
|| uid
!= s
->user
->user_record
->uid
))
358 return sd_bus_error_setf(error
, SD_BUS_ERROR_ACCESS_DENIED
, "Only owner of session may take control");
360 r
= session_set_controller(s
, sd_bus_message_get_sender(message
), force
, true);
364 return sd_bus_reply_method_return(message
, NULL
);
367 static int method_release_control(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
368 Session
*s
= userdata
;
373 if (!session_is_controller(s
, sd_bus_message_get_sender(message
)))
374 return sd_bus_error_setf(error
, BUS_ERROR_NOT_IN_CONTROL
, "You are not in control of this session");
376 session_drop_controller(s
);
378 return sd_bus_reply_method_return(message
, NULL
);
381 static int method_take_device(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
382 Session
*s
= userdata
;
383 uint32_t major
, minor
;
391 r
= sd_bus_message_read(message
, "uu", &major
, &minor
);
395 if (!DEVICE_MAJOR_VALID(major
) || !DEVICE_MINOR_VALID(minor
))
396 return sd_bus_error_setf(error
, SD_BUS_ERROR_INVALID_ARGS
, "Device major/minor is not valid.");
398 if (!session_is_controller(s
, sd_bus_message_get_sender(message
)))
399 return sd_bus_error_setf(error
, BUS_ERROR_NOT_IN_CONTROL
, "You are not in control of this session");
401 dev
= makedev(major
, minor
);
402 sd
= hashmap_get(s
->devices
, &dev
);
404 /* We don't allow retrieving a device multiple times.
405 * The related ReleaseDevice call is not ref-counted.
406 * The caller should use dup() if it requires more
407 * than one fd (it would be functionally
409 return sd_bus_error_setf(error
, BUS_ERROR_DEVICE_IS_TAKEN
, "Device already taken");
411 r
= session_device_new(s
, dev
, true, &sd
);
415 r
= session_device_save(sd
);
419 r
= sd_bus_reply_method_return(message
, "hb", sd
->fd
, !sd
->active
);
427 session_device_free(sd
);
431 static int method_release_device(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
432 Session
*s
= userdata
;
433 uint32_t major
, minor
;
441 r
= sd_bus_message_read(message
, "uu", &major
, &minor
);
445 if (!DEVICE_MAJOR_VALID(major
) || !DEVICE_MINOR_VALID(minor
))
446 return sd_bus_error_setf(error
, SD_BUS_ERROR_INVALID_ARGS
, "Device major/minor is not valid.");
448 if (!session_is_controller(s
, sd_bus_message_get_sender(message
)))
449 return sd_bus_error_setf(error
, BUS_ERROR_NOT_IN_CONTROL
, "You are not in control of this session");
451 dev
= makedev(major
, minor
);
452 sd
= hashmap_get(s
->devices
, &dev
);
454 return sd_bus_error_setf(error
, BUS_ERROR_DEVICE_NOT_TAKEN
, "Device not taken");
456 session_device_free(sd
);
459 return sd_bus_reply_method_return(message
, NULL
);
462 static int method_pause_device_complete(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
463 Session
*s
= userdata
;
464 uint32_t major
, minor
;
472 r
= sd_bus_message_read(message
, "uu", &major
, &minor
);
476 if (!DEVICE_MAJOR_VALID(major
) || !DEVICE_MINOR_VALID(minor
))
477 return sd_bus_error_setf(error
, SD_BUS_ERROR_INVALID_ARGS
, "Device major/minor is not valid.");
479 if (!session_is_controller(s
, sd_bus_message_get_sender(message
)))
480 return sd_bus_error_setf(error
, BUS_ERROR_NOT_IN_CONTROL
, "You are not in control of this session");
482 dev
= makedev(major
, minor
);
483 sd
= hashmap_get(s
->devices
, &dev
);
485 return sd_bus_error_setf(error
, BUS_ERROR_DEVICE_NOT_TAKEN
, "Device not taken");
487 session_device_complete_pause(sd
);
489 return sd_bus_reply_method_return(message
, NULL
);
492 static int method_set_brightness(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
493 _cleanup_(sd_bus_creds_unrefp
) sd_bus_creds
*creds
= NULL
;
494 _cleanup_(sd_device_unrefp
) sd_device
*d
= NULL
;
495 const char *subsystem
, *name
, *seat
;
496 Session
*s
= userdata
;
504 r
= sd_bus_message_read(message
, "ssu", &subsystem
, &name
, &brightness
);
508 if (!STR_IN_SET(subsystem
, "backlight", "leds"))
509 return sd_bus_error_setf(error
, SD_BUS_ERROR_NOT_SUPPORTED
, "Subsystem type %s not supported, must be one of 'backlight' or 'leds'.", subsystem
);
510 if (!filename_is_valid(name
))
511 return sd_bus_error_setf(error
, SD_BUS_ERROR_INVALID_ARGS
, "Not a valid device name %s, refusing.", name
);
514 return sd_bus_error_setf(error
, BUS_ERROR_NOT_YOUR_DEVICE
, "Your session has no seat, refusing.");
515 if (s
->seat
->active
!= s
)
516 return sd_bus_error_setf(error
, BUS_ERROR_NOT_YOUR_DEVICE
, "Session is not in foreground, refusing.");
518 r
= sd_bus_query_sender_creds(message
, SD_BUS_CREDS_EUID
, &creds
);
522 r
= sd_bus_creds_get_euid(creds
, &uid
);
526 if (uid
!= 0 && uid
!= s
->user
->user_record
->uid
)
527 return sd_bus_error_setf(error
, SD_BUS_ERROR_ACCESS_DENIED
, "Only owner of session may change brightness.");
529 r
= sd_device_new_from_subsystem_sysname(&d
, subsystem
, name
);
531 return sd_bus_error_set_errnof(error
, r
, "Failed to open device %s:%s: %m", subsystem
, name
);
533 if (sd_device_get_property_value(d
, "ID_SEAT", &seat
) >= 0 && !streq_ptr(seat
, s
->seat
->id
))
534 return sd_bus_error_setf(error
, BUS_ERROR_NOT_YOUR_DEVICE
, "Device %s:%s does not belong to your seat %s, refusing.", subsystem
, name
, s
->seat
->id
);
536 r
= manager_write_brightness(s
->manager
, d
, brightness
, message
);
543 const sd_bus_vtable session_vtable
[] = {
544 SD_BUS_VTABLE_START(0),
546 SD_BUS_PROPERTY("Id", "s", NULL
, offsetof(Session
, id
), SD_BUS_VTABLE_PROPERTY_CONST
),
547 SD_BUS_PROPERTY("User", "(uo)", property_get_user
, 0, SD_BUS_VTABLE_PROPERTY_CONST
),
548 SD_BUS_PROPERTY("Name", "s", property_get_name
, 0, SD_BUS_VTABLE_PROPERTY_CONST
),
549 BUS_PROPERTY_DUAL_TIMESTAMP("Timestamp", offsetof(Session
, timestamp
), SD_BUS_VTABLE_PROPERTY_CONST
),
550 SD_BUS_PROPERTY("VTNr", "u", NULL
, offsetof(Session
, vtnr
), SD_BUS_VTABLE_PROPERTY_CONST
),
551 SD_BUS_PROPERTY("Seat", "(so)", property_get_seat
, 0, SD_BUS_VTABLE_PROPERTY_CONST
),
552 SD_BUS_PROPERTY("TTY", "s", NULL
, offsetof(Session
, tty
), SD_BUS_VTABLE_PROPERTY_CONST
),
553 SD_BUS_PROPERTY("Display", "s", NULL
, offsetof(Session
, display
), SD_BUS_VTABLE_PROPERTY_CONST
),
554 SD_BUS_PROPERTY("Remote", "b", bus_property_get_bool
, offsetof(Session
, remote
), SD_BUS_VTABLE_PROPERTY_CONST
),
555 SD_BUS_PROPERTY("RemoteHost", "s", NULL
, offsetof(Session
, remote_host
), SD_BUS_VTABLE_PROPERTY_CONST
),
556 SD_BUS_PROPERTY("RemoteUser", "s", NULL
, offsetof(Session
, remote_user
), SD_BUS_VTABLE_PROPERTY_CONST
),
557 SD_BUS_PROPERTY("Service", "s", NULL
, offsetof(Session
, service
), SD_BUS_VTABLE_PROPERTY_CONST
),
558 SD_BUS_PROPERTY("Desktop", "s", NULL
, offsetof(Session
, desktop
), SD_BUS_VTABLE_PROPERTY_CONST
),
559 SD_BUS_PROPERTY("Scope", "s", NULL
, offsetof(Session
, scope
), SD_BUS_VTABLE_PROPERTY_CONST
),
560 SD_BUS_PROPERTY("Leader", "u", bus_property_get_pid
, offsetof(Session
, leader
), SD_BUS_VTABLE_PROPERTY_CONST
),
561 SD_BUS_PROPERTY("Audit", "u", NULL
, offsetof(Session
, audit_id
), SD_BUS_VTABLE_PROPERTY_CONST
),
562 SD_BUS_PROPERTY("Type", "s", property_get_type
, offsetof(Session
, type
), SD_BUS_VTABLE_PROPERTY_CONST
),
563 SD_BUS_PROPERTY("Class", "s", property_get_class
, offsetof(Session
, class), SD_BUS_VTABLE_PROPERTY_CONST
),
564 SD_BUS_PROPERTY("Active", "b", property_get_active
, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE
),
565 SD_BUS_PROPERTY("State", "s", property_get_state
, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE
),
566 SD_BUS_PROPERTY("IdleHint", "b", property_get_idle_hint
, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE
),
567 SD_BUS_PROPERTY("IdleSinceHint", "t", property_get_idle_since_hint
, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE
),
568 SD_BUS_PROPERTY("IdleSinceHintMonotonic", "t", property_get_idle_since_hint
, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE
),
569 SD_BUS_PROPERTY("LockedHint", "b", property_get_locked_hint
, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE
),
571 SD_BUS_METHOD("Terminate", NULL
, NULL
, bus_session_method_terminate
, SD_BUS_VTABLE_UNPRIVILEGED
),
572 SD_BUS_METHOD("Activate", NULL
, NULL
, bus_session_method_activate
, SD_BUS_VTABLE_UNPRIVILEGED
),
573 SD_BUS_METHOD("Lock", NULL
, NULL
, bus_session_method_lock
, SD_BUS_VTABLE_UNPRIVILEGED
),
574 SD_BUS_METHOD("Unlock", NULL
, NULL
, bus_session_method_lock
, SD_BUS_VTABLE_UNPRIVILEGED
),
575 SD_BUS_METHOD("SetIdleHint", "b", NULL
, method_set_idle_hint
, SD_BUS_VTABLE_UNPRIVILEGED
),
576 SD_BUS_METHOD("SetLockedHint", "b", NULL
, method_set_locked_hint
, SD_BUS_VTABLE_UNPRIVILEGED
),
577 SD_BUS_METHOD("Kill", "si", NULL
, bus_session_method_kill
, SD_BUS_VTABLE_UNPRIVILEGED
),
578 SD_BUS_METHOD("TakeControl", "b", NULL
, method_take_control
, SD_BUS_VTABLE_UNPRIVILEGED
),
579 SD_BUS_METHOD("ReleaseControl", NULL
, NULL
, method_release_control
, SD_BUS_VTABLE_UNPRIVILEGED
),
580 SD_BUS_METHOD("TakeDevice", "uu", "hb", method_take_device
, SD_BUS_VTABLE_UNPRIVILEGED
),
581 SD_BUS_METHOD("ReleaseDevice", "uu", NULL
, method_release_device
, SD_BUS_VTABLE_UNPRIVILEGED
),
582 SD_BUS_METHOD("PauseDeviceComplete", "uu", NULL
, method_pause_device_complete
, SD_BUS_VTABLE_UNPRIVILEGED
),
583 SD_BUS_METHOD("SetBrightness", "ssu", NULL
, method_set_brightness
, SD_BUS_VTABLE_UNPRIVILEGED
),
585 SD_BUS_SIGNAL("PauseDevice", "uus", 0),
586 SD_BUS_SIGNAL("ResumeDevice", "uuh", 0),
587 SD_BUS_SIGNAL("Lock", NULL
, 0),
588 SD_BUS_SIGNAL("Unlock", NULL
, 0),
593 int session_object_find(sd_bus
*bus
, const char *path
, const char *interface
, void *userdata
, void **found
, sd_bus_error
*error
) {
594 _cleanup_free_
char *e
= NULL
;
595 sd_bus_message
*message
;
596 Manager
*m
= userdata
;
607 p
= startswith(path
, "/org/freedesktop/login1/session/");
611 e
= bus_label_unescape(p
);
615 message
= sd_bus_get_current_message(bus
);
617 r
= manager_get_session_from_creds(m
, message
, e
, error
, &session
);
619 sd_bus_error_free(error
);
629 char *session_bus_path(Session
*s
) {
630 _cleanup_free_
char *t
= NULL
;
634 t
= bus_label_escape(s
->id
);
638 return strjoin("/org/freedesktop/login1/session/", t
);
641 int session_node_enumerator(sd_bus
*bus
, const char *path
, void *userdata
, char ***nodes
, sd_bus_error
*error
) {
642 _cleanup_strv_free_
char **l
= NULL
;
643 sd_bus_message
*message
;
644 Manager
*m
= userdata
;
653 HASHMAP_FOREACH(session
, m
->sessions
, i
) {
656 p
= session_bus_path(session
);
660 r
= strv_consume(&l
, p
);
665 message
= sd_bus_get_current_message(bus
);
667 _cleanup_(sd_bus_creds_unrefp
) sd_bus_creds
*creds
= NULL
;
669 r
= sd_bus_query_sender_creds(message
, SD_BUS_CREDS_SESSION
|SD_BUS_CREDS_OWNER_UID
|SD_BUS_CREDS_AUGMENT
, &creds
);
671 bool may_auto
= false;
674 r
= sd_bus_creds_get_session(creds
, &name
);
676 session
= hashmap_get(m
->sessions
, name
);
678 r
= strv_extend(&l
, "/org/freedesktop/login1/session/self");
689 r
= sd_bus_creds_get_owner_uid(creds
, &uid
);
693 user
= hashmap_get(m
->users
, UID_TO_PTR(uid
));
694 may_auto
= user
&& user
->display
;
699 r
= strv_extend(&l
, "/org/freedesktop/login1/session/auto");
706 *nodes
= TAKE_PTR(l
);
710 int session_send_signal(Session
*s
, bool new_session
) {
711 _cleanup_free_
char *p
= NULL
;
715 p
= session_bus_path(s
);
719 return sd_bus_emit_signal(
721 "/org/freedesktop/login1",
722 "org.freedesktop.login1.Manager",
723 new_session
? "SessionNew" : "SessionRemoved",
727 int session_send_changed(Session
*s
, const char *properties
, ...) {
728 _cleanup_free_
char *p
= NULL
;
736 p
= session_bus_path(s
);
740 l
= strv_from_stdarg_alloca(properties
);
742 return sd_bus_emit_properties_changed_strv(s
->manager
->bus
, p
, "org.freedesktop.login1.Session", l
);
745 int session_send_lock(Session
*s
, bool lock
) {
746 _cleanup_free_
char *p
= NULL
;
750 p
= session_bus_path(s
);
754 return sd_bus_emit_signal(
757 "org.freedesktop.login1.Session",
758 lock
? "Lock" : "Unlock",
762 int session_send_lock_all(Manager
*m
, bool lock
) {
769 HASHMAP_FOREACH(session
, m
->sessions
, i
) {
772 k
= session_send_lock(session
, lock
);
780 static bool session_ready(Session
*s
) {
783 /* Returns true when the session is ready, i.e. all jobs we enqueued for it are done (regardless if successful or not) */
785 return !s
->scope_job
&&
786 !s
->user
->service_job
;
789 int session_send_create_reply(Session
*s
, sd_bus_error
*error
) {
790 _cleanup_(sd_bus_message_unrefp
) sd_bus_message
*c
= NULL
;
791 _cleanup_close_
int fifo_fd
= -1;
792 _cleanup_free_
char *p
= NULL
;
796 /* This is called after the session scope and the user service were successfully created, and finishes where
797 * bus_manager_create_session() left off. */
799 if (!s
->create_message
)
802 if (!sd_bus_error_is_set(error
) && !session_ready(s
))
805 c
= TAKE_PTR(s
->create_message
);
807 return sd_bus_reply_method_error(c
, error
);
809 fifo_fd
= session_create_fifo(s
);
813 /* Update the session state file before we notify the client about the result. */
816 p
= session_bus_path(s
);
820 log_debug("Sending reply about created session: "
821 "id=%s object_path=%s uid=%u runtime_path=%s "
822 "session_fd=%d seat=%s vtnr=%u",
825 (uint32_t) s
->user
->user_record
->uid
,
826 s
->user
->runtime_path
,
828 s
->seat
? s
->seat
->id
: "",
831 return sd_bus_reply_method_return(
835 s
->user
->runtime_path
,
837 (uint32_t) s
->user
->user_record
->uid
,
838 s
->seat
? s
->seat
->id
: "",