1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 #include "alloc-util.h"
6 #include "bus-common-errors.h"
8 #include "bus-polkit.h"
11 #include "logind-brightness.h"
12 #include "logind-dbus.h"
13 #include "logind-seat-dbus.h"
14 #include "logind-session-dbus.h"
15 #include "logind-session-device.h"
16 #include "logind-session.h"
17 #include "logind-user-dbus.h"
19 #include "missing_capability.h"
20 #include "path-util.h"
21 #include "signal-util.h"
22 #include "stat-util.h"
24 #include "user-util.h"
27 static int property_get_user(
30 const char *interface
,
32 sd_bus_message
*reply
,
34 sd_bus_error
*error
) {
36 _cleanup_free_
char *p
= NULL
;
37 Session
*s
= userdata
;
43 p
= user_bus_path(s
->user
);
47 return sd_bus_message_append(reply
, "(uo)", (uint32_t) s
->user
->user_record
->uid
, p
);
50 static int property_get_name(
53 const char *interface
,
55 sd_bus_message
*reply
,
57 sd_bus_error
*error
) {
59 Session
*s
= userdata
;
65 return sd_bus_message_append(reply
, "s", s
->user
->user_record
->user_name
);
68 static int property_get_seat(
71 const char *interface
,
73 sd_bus_message
*reply
,
75 sd_bus_error
*error
) {
77 _cleanup_free_
char *p
= NULL
;
78 Session
*s
= userdata
;
84 p
= s
->seat
? seat_bus_path(s
->seat
) : strdup("/");
88 return sd_bus_message_append(reply
, "(so)", s
->seat
? s
->seat
->id
: "", p
);
91 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_type
, session_type
, SessionType
);
92 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_class
, session_class
, SessionClass
);
93 static BUS_DEFINE_PROPERTY_GET(property_get_active
, "b", Session
, session_is_active
);
94 static BUS_DEFINE_PROPERTY_GET2(property_get_state
, "s", Session
, session_get_state
, session_state_to_string
);
96 static int property_get_idle_hint(
99 const char *interface
,
100 const char *property
,
101 sd_bus_message
*reply
,
103 sd_bus_error
*error
) {
105 Session
*s
= userdata
;
111 return sd_bus_message_append(reply
, "b", session_get_idle_hint(s
, NULL
) > 0);
114 static int property_get_idle_since_hint(
117 const char *interface
,
118 const char *property
,
119 sd_bus_message
*reply
,
121 sd_bus_error
*error
) {
123 Session
*s
= userdata
;
124 dual_timestamp t
= DUAL_TIMESTAMP_NULL
;
132 r
= session_get_idle_hint(s
, &t
);
136 u
= streq(property
, "IdleSinceHint") ? t
.realtime
: t
.monotonic
;
138 return sd_bus_message_append(reply
, "t", u
);
141 static int property_get_locked_hint(
144 const char *interface
,
145 const char *property
,
146 sd_bus_message
*reply
,
148 sd_bus_error
*error
) {
150 Session
*s
= userdata
;
156 return sd_bus_message_append(reply
, "b", session_get_locked_hint(s
) > 0);
159 int bus_session_method_terminate(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
160 Session
*s
= userdata
;
166 r
= bus_verify_polkit_async(
169 "org.freedesktop.login1.manage",
172 s
->user
->user_record
->uid
,
173 &s
->manager
->polkit_registry
,
178 return 1; /* Will call us back */
180 r
= session_stop(s
, true);
184 return sd_bus_reply_method_return(message
, NULL
);
187 int bus_session_method_activate(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
188 Session
*s
= userdata
;
194 r
= session_activate(s
);
198 return sd_bus_reply_method_return(message
, NULL
);
201 int bus_session_method_lock(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
202 Session
*s
= userdata
;
208 r
= bus_verify_polkit_async(
211 "org.freedesktop.login1.lock-sessions",
214 s
->user
->user_record
->uid
,
215 &s
->manager
->polkit_registry
,
220 return 1; /* Will call us back */
222 r
= session_send_lock(s
, strstr(sd_bus_message_get_member(message
), "Lock"));
226 return sd_bus_reply_method_return(message
, NULL
);
229 static int method_set_idle_hint(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
230 _cleanup_(sd_bus_creds_unrefp
) sd_bus_creds
*creds
= NULL
;
231 Session
*s
= userdata
;
238 r
= sd_bus_message_read(message
, "b", &b
);
242 r
= sd_bus_query_sender_creds(message
, SD_BUS_CREDS_EUID
, &creds
);
246 r
= sd_bus_creds_get_euid(creds
, &uid
);
250 if (uid
!= 0 && uid
!= s
->user
->user_record
->uid
)
251 return sd_bus_error_setf(error
, SD_BUS_ERROR_ACCESS_DENIED
, "Only owner of session may set idle hint");
253 r
= session_set_idle_hint(s
, b
);
255 return sd_bus_error_setf(error
, SD_BUS_ERROR_NOT_SUPPORTED
, "Idle hint control is not supported on non-graphical sessions.");
259 return sd_bus_reply_method_return(message
, NULL
);
262 static int method_set_locked_hint(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
263 _cleanup_(sd_bus_creds_unrefp
) sd_bus_creds
*creds
= NULL
;
264 Session
*s
= userdata
;
271 r
= sd_bus_message_read(message
, "b", &b
);
275 r
= sd_bus_query_sender_creds(message
, SD_BUS_CREDS_EUID
, &creds
);
279 r
= sd_bus_creds_get_euid(creds
, &uid
);
283 if (uid
!= 0 && uid
!= s
->user
->user_record
->uid
)
284 return sd_bus_error_setf(error
, SD_BUS_ERROR_ACCESS_DENIED
, "Only owner of session may set locked hint");
286 session_set_locked_hint(s
, b
);
288 return sd_bus_reply_method_return(message
, NULL
);
291 int bus_session_method_kill(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
292 Session
*s
= userdata
;
301 r
= sd_bus_message_read(message
, "si", &swho
, &signo
);
308 who
= kill_who_from_string(swho
);
310 return sd_bus_error_setf(error
, SD_BUS_ERROR_INVALID_ARGS
, "Invalid kill parameter '%s'", swho
);
313 if (!SIGNAL_VALID(signo
))
314 return sd_bus_error_setf(error
, SD_BUS_ERROR_INVALID_ARGS
, "Invalid signal %i", signo
);
316 r
= bus_verify_polkit_async(
319 "org.freedesktop.login1.manage",
322 s
->user
->user_record
->uid
,
323 &s
->manager
->polkit_registry
,
328 return 1; /* Will call us back */
330 r
= session_kill(s
, who
, signo
);
334 return sd_bus_reply_method_return(message
, NULL
);
337 static int method_take_control(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
338 _cleanup_(sd_bus_creds_unrefp
) sd_bus_creds
*creds
= NULL
;
339 Session
*s
= userdata
;
346 r
= sd_bus_message_read(message
, "b", &force
);
350 r
= sd_bus_query_sender_creds(message
, SD_BUS_CREDS_EUID
, &creds
);
354 r
= sd_bus_creds_get_euid(creds
, &uid
);
358 if (uid
!= 0 && (force
|| uid
!= s
->user
->user_record
->uid
))
359 return sd_bus_error_setf(error
, SD_BUS_ERROR_ACCESS_DENIED
, "Only owner of session may take control");
361 r
= session_set_controller(s
, sd_bus_message_get_sender(message
), force
, true);
365 return sd_bus_reply_method_return(message
, NULL
);
368 static int method_release_control(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
369 Session
*s
= userdata
;
374 if (!session_is_controller(s
, sd_bus_message_get_sender(message
)))
375 return sd_bus_error_setf(error
, BUS_ERROR_NOT_IN_CONTROL
, "You are not in control of this session");
377 session_drop_controller(s
);
379 return sd_bus_reply_method_return(message
, NULL
);
382 static int method_take_device(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
383 Session
*s
= userdata
;
384 uint32_t major
, minor
;
392 r
= sd_bus_message_read(message
, "uu", &major
, &minor
);
396 if (!DEVICE_MAJOR_VALID(major
) || !DEVICE_MINOR_VALID(minor
))
397 return sd_bus_error_setf(error
, SD_BUS_ERROR_INVALID_ARGS
, "Device major/minor is not valid.");
399 if (!session_is_controller(s
, sd_bus_message_get_sender(message
)))
400 return sd_bus_error_setf(error
, BUS_ERROR_NOT_IN_CONTROL
, "You are not in control of this session");
402 dev
= makedev(major
, minor
);
403 sd
= hashmap_get(s
->devices
, &dev
);
405 /* We don't allow retrieving a device multiple times.
406 * The related ReleaseDevice call is not ref-counted.
407 * The caller should use dup() if it requires more
408 * than one fd (it would be functionally
410 return sd_bus_error_setf(error
, BUS_ERROR_DEVICE_IS_TAKEN
, "Device already taken");
412 r
= session_device_new(s
, dev
, true, &sd
);
416 r
= session_device_save(sd
);
420 r
= sd_bus_reply_method_return(message
, "hb", sd
->fd
, !sd
->active
);
428 session_device_free(sd
);
432 static int method_release_device(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
433 Session
*s
= userdata
;
434 uint32_t major
, minor
;
442 r
= sd_bus_message_read(message
, "uu", &major
, &minor
);
446 if (!DEVICE_MAJOR_VALID(major
) || !DEVICE_MINOR_VALID(minor
))
447 return sd_bus_error_setf(error
, SD_BUS_ERROR_INVALID_ARGS
, "Device major/minor is not valid.");
449 if (!session_is_controller(s
, sd_bus_message_get_sender(message
)))
450 return sd_bus_error_setf(error
, BUS_ERROR_NOT_IN_CONTROL
, "You are not in control of this session");
452 dev
= makedev(major
, minor
);
453 sd
= hashmap_get(s
->devices
, &dev
);
455 return sd_bus_error_setf(error
, BUS_ERROR_DEVICE_NOT_TAKEN
, "Device not taken");
457 session_device_free(sd
);
460 return sd_bus_reply_method_return(message
, NULL
);
463 static int method_pause_device_complete(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
464 Session
*s
= userdata
;
465 uint32_t major
, minor
;
473 r
= sd_bus_message_read(message
, "uu", &major
, &minor
);
477 if (!DEVICE_MAJOR_VALID(major
) || !DEVICE_MINOR_VALID(minor
))
478 return sd_bus_error_setf(error
, SD_BUS_ERROR_INVALID_ARGS
, "Device major/minor is not valid.");
480 if (!session_is_controller(s
, sd_bus_message_get_sender(message
)))
481 return sd_bus_error_setf(error
, BUS_ERROR_NOT_IN_CONTROL
, "You are not in control of this session");
483 dev
= makedev(major
, minor
);
484 sd
= hashmap_get(s
->devices
, &dev
);
486 return sd_bus_error_setf(error
, BUS_ERROR_DEVICE_NOT_TAKEN
, "Device not taken");
488 session_device_complete_pause(sd
);
490 return sd_bus_reply_method_return(message
, NULL
);
493 static int method_set_brightness(sd_bus_message
*message
, void *userdata
, sd_bus_error
*error
) {
494 _cleanup_(sd_bus_creds_unrefp
) sd_bus_creds
*creds
= NULL
;
495 _cleanup_(sd_device_unrefp
) sd_device
*d
= NULL
;
496 const char *subsystem
, *name
, *seat
;
497 Session
*s
= userdata
;
505 r
= sd_bus_message_read(message
, "ssu", &subsystem
, &name
, &brightness
);
509 if (!STR_IN_SET(subsystem
, "backlight", "leds"))
510 return sd_bus_error_setf(error
, SD_BUS_ERROR_NOT_SUPPORTED
, "Subsystem type %s not supported, must be one of 'backlight' or 'leds'.", subsystem
);
511 if (!filename_is_valid(name
))
512 return sd_bus_error_setf(error
, SD_BUS_ERROR_INVALID_ARGS
, "Not a valid device name %s, refusing.", name
);
515 return sd_bus_error_setf(error
, BUS_ERROR_NOT_YOUR_DEVICE
, "Your session has no seat, refusing.");
516 if (s
->seat
->active
!= s
)
517 return sd_bus_error_setf(error
, BUS_ERROR_NOT_YOUR_DEVICE
, "Session is not in foreground, refusing.");
519 r
= sd_bus_query_sender_creds(message
, SD_BUS_CREDS_EUID
, &creds
);
523 r
= sd_bus_creds_get_euid(creds
, &uid
);
527 if (uid
!= 0 && uid
!= s
->user
->user_record
->uid
)
528 return sd_bus_error_setf(error
, SD_BUS_ERROR_ACCESS_DENIED
, "Only owner of session may change brightness.");
530 r
= sd_device_new_from_subsystem_sysname(&d
, subsystem
, name
);
532 return sd_bus_error_set_errnof(error
, r
, "Failed to open device %s:%s: %m", subsystem
, name
);
534 if (sd_device_get_property_value(d
, "ID_SEAT", &seat
) >= 0 && !streq_ptr(seat
, s
->seat
->id
))
535 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
);
537 r
= manager_write_brightness(s
->manager
, d
, brightness
, message
);
544 const sd_bus_vtable session_vtable
[] = {
545 SD_BUS_VTABLE_START(0),
547 SD_BUS_PROPERTY("Id", "s", NULL
, offsetof(Session
, id
), SD_BUS_VTABLE_PROPERTY_CONST
),
548 SD_BUS_PROPERTY("User", "(uo)", property_get_user
, 0, SD_BUS_VTABLE_PROPERTY_CONST
),
549 SD_BUS_PROPERTY("Name", "s", property_get_name
, 0, SD_BUS_VTABLE_PROPERTY_CONST
),
550 BUS_PROPERTY_DUAL_TIMESTAMP("Timestamp", offsetof(Session
, timestamp
), SD_BUS_VTABLE_PROPERTY_CONST
),
551 SD_BUS_PROPERTY("VTNr", "u", NULL
, offsetof(Session
, vtnr
), SD_BUS_VTABLE_PROPERTY_CONST
),
552 SD_BUS_PROPERTY("Seat", "(so)", property_get_seat
, 0, SD_BUS_VTABLE_PROPERTY_CONST
),
553 SD_BUS_PROPERTY("TTY", "s", NULL
, offsetof(Session
, tty
), SD_BUS_VTABLE_PROPERTY_CONST
),
554 SD_BUS_PROPERTY("Display", "s", NULL
, offsetof(Session
, display
), SD_BUS_VTABLE_PROPERTY_CONST
),
555 SD_BUS_PROPERTY("Remote", "b", bus_property_get_bool
, offsetof(Session
, remote
), SD_BUS_VTABLE_PROPERTY_CONST
),
556 SD_BUS_PROPERTY("RemoteHost", "s", NULL
, offsetof(Session
, remote_host
), SD_BUS_VTABLE_PROPERTY_CONST
),
557 SD_BUS_PROPERTY("RemoteUser", "s", NULL
, offsetof(Session
, remote_user
), SD_BUS_VTABLE_PROPERTY_CONST
),
558 SD_BUS_PROPERTY("Service", "s", NULL
, offsetof(Session
, service
), SD_BUS_VTABLE_PROPERTY_CONST
),
559 SD_BUS_PROPERTY("Desktop", "s", NULL
, offsetof(Session
, desktop
), SD_BUS_VTABLE_PROPERTY_CONST
),
560 SD_BUS_PROPERTY("Scope", "s", NULL
, offsetof(Session
, scope
), SD_BUS_VTABLE_PROPERTY_CONST
),
561 SD_BUS_PROPERTY("Leader", "u", bus_property_get_pid
, offsetof(Session
, leader
), SD_BUS_VTABLE_PROPERTY_CONST
),
562 SD_BUS_PROPERTY("Audit", "u", NULL
, offsetof(Session
, audit_id
), SD_BUS_VTABLE_PROPERTY_CONST
),
563 SD_BUS_PROPERTY("Type", "s", property_get_type
, offsetof(Session
, type
), SD_BUS_VTABLE_PROPERTY_CONST
),
564 SD_BUS_PROPERTY("Class", "s", property_get_class
, offsetof(Session
, class), SD_BUS_VTABLE_PROPERTY_CONST
),
565 SD_BUS_PROPERTY("Active", "b", property_get_active
, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE
),
566 SD_BUS_PROPERTY("State", "s", property_get_state
, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE
),
567 SD_BUS_PROPERTY("IdleHint", "b", property_get_idle_hint
, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE
),
568 SD_BUS_PROPERTY("IdleSinceHint", "t", property_get_idle_since_hint
, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE
),
569 SD_BUS_PROPERTY("IdleSinceHintMonotonic", "t", property_get_idle_since_hint
, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE
),
570 SD_BUS_PROPERTY("LockedHint", "b", property_get_locked_hint
, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE
),
572 SD_BUS_METHOD("Terminate", NULL
, NULL
, bus_session_method_terminate
, SD_BUS_VTABLE_UNPRIVILEGED
),
573 SD_BUS_METHOD("Activate", NULL
, NULL
, bus_session_method_activate
, SD_BUS_VTABLE_UNPRIVILEGED
),
574 SD_BUS_METHOD("Lock", NULL
, NULL
, bus_session_method_lock
, SD_BUS_VTABLE_UNPRIVILEGED
),
575 SD_BUS_METHOD("Unlock", NULL
, NULL
, bus_session_method_lock
, SD_BUS_VTABLE_UNPRIVILEGED
),
576 SD_BUS_METHOD("SetIdleHint", "b", NULL
, method_set_idle_hint
, SD_BUS_VTABLE_UNPRIVILEGED
),
577 SD_BUS_METHOD("SetLockedHint", "b", NULL
, method_set_locked_hint
, SD_BUS_VTABLE_UNPRIVILEGED
),
578 SD_BUS_METHOD("Kill", "si", NULL
, bus_session_method_kill
, SD_BUS_VTABLE_UNPRIVILEGED
),
579 SD_BUS_METHOD("TakeControl", "b", NULL
, method_take_control
, SD_BUS_VTABLE_UNPRIVILEGED
),
580 SD_BUS_METHOD("ReleaseControl", NULL
, NULL
, method_release_control
, SD_BUS_VTABLE_UNPRIVILEGED
),
581 SD_BUS_METHOD("TakeDevice", "uu", "hb", method_take_device
, SD_BUS_VTABLE_UNPRIVILEGED
),
582 SD_BUS_METHOD("ReleaseDevice", "uu", NULL
, method_release_device
, SD_BUS_VTABLE_UNPRIVILEGED
),
583 SD_BUS_METHOD("PauseDeviceComplete", "uu", NULL
, method_pause_device_complete
, SD_BUS_VTABLE_UNPRIVILEGED
),
584 SD_BUS_METHOD("SetBrightness", "ssu", NULL
, method_set_brightness
, SD_BUS_VTABLE_UNPRIVILEGED
),
586 SD_BUS_SIGNAL("PauseDevice", "uus", 0),
587 SD_BUS_SIGNAL("ResumeDevice", "uuh", 0),
588 SD_BUS_SIGNAL("Lock", NULL
, 0),
589 SD_BUS_SIGNAL("Unlock", NULL
, 0),
594 int session_object_find(sd_bus
*bus
, const char *path
, const char *interface
, void *userdata
, void **found
, sd_bus_error
*error
) {
595 _cleanup_free_
char *e
= NULL
;
596 sd_bus_message
*message
;
597 Manager
*m
= userdata
;
608 p
= startswith(path
, "/org/freedesktop/login1/session/");
612 e
= bus_label_unescape(p
);
616 message
= sd_bus_get_current_message(bus
);
618 r
= manager_get_session_from_creds(m
, message
, e
, error
, &session
);
620 sd_bus_error_free(error
);
630 char *session_bus_path(Session
*s
) {
631 _cleanup_free_
char *t
= NULL
;
635 t
= bus_label_escape(s
->id
);
639 return strjoin("/org/freedesktop/login1/session/", t
);
642 int session_node_enumerator(sd_bus
*bus
, const char *path
, void *userdata
, char ***nodes
, sd_bus_error
*error
) {
643 _cleanup_strv_free_
char **l
= NULL
;
644 sd_bus_message
*message
;
645 Manager
*m
= userdata
;
654 HASHMAP_FOREACH(session
, m
->sessions
, i
) {
657 p
= session_bus_path(session
);
661 r
= strv_consume(&l
, p
);
666 message
= sd_bus_get_current_message(bus
);
668 _cleanup_(sd_bus_creds_unrefp
) sd_bus_creds
*creds
= NULL
;
670 r
= sd_bus_query_sender_creds(message
, SD_BUS_CREDS_SESSION
|SD_BUS_CREDS_OWNER_UID
|SD_BUS_CREDS_AUGMENT
, &creds
);
672 bool may_auto
= false;
675 r
= sd_bus_creds_get_session(creds
, &name
);
677 session
= hashmap_get(m
->sessions
, name
);
679 r
= strv_extend(&l
, "/org/freedesktop/login1/session/self");
690 r
= sd_bus_creds_get_owner_uid(creds
, &uid
);
694 user
= hashmap_get(m
->users
, UID_TO_PTR(uid
));
695 may_auto
= user
&& user
->display
;
700 r
= strv_extend(&l
, "/org/freedesktop/login1/session/auto");
707 *nodes
= TAKE_PTR(l
);
711 int session_send_signal(Session
*s
, bool new_session
) {
712 _cleanup_free_
char *p
= NULL
;
716 p
= session_bus_path(s
);
720 return sd_bus_emit_signal(
722 "/org/freedesktop/login1",
723 "org.freedesktop.login1.Manager",
724 new_session
? "SessionNew" : "SessionRemoved",
728 int session_send_changed(Session
*s
, const char *properties
, ...) {
729 _cleanup_free_
char *p
= NULL
;
737 p
= session_bus_path(s
);
741 l
= strv_from_stdarg_alloca(properties
);
743 return sd_bus_emit_properties_changed_strv(s
->manager
->bus
, p
, "org.freedesktop.login1.Session", l
);
746 int session_send_lock(Session
*s
, bool lock
) {
747 _cleanup_free_
char *p
= NULL
;
751 p
= session_bus_path(s
);
755 return sd_bus_emit_signal(
758 "org.freedesktop.login1.Session",
759 lock
? "Lock" : "Unlock",
763 int session_send_lock_all(Manager
*m
, bool lock
) {
770 HASHMAP_FOREACH(session
, m
->sessions
, i
) {
773 k
= session_send_lock(session
, lock
);
781 static bool session_ready(Session
*s
) {
784 /* Returns true when the session is ready, i.e. all jobs we enqueued for it are done (regardless if successful or not) */
786 return !s
->scope_job
&&
787 !s
->user
->service_job
;
790 int session_send_create_reply(Session
*s
, sd_bus_error
*error
) {
791 _cleanup_(sd_bus_message_unrefp
) sd_bus_message
*c
= NULL
;
792 _cleanup_close_
int fifo_fd
= -1;
793 _cleanup_free_
char *p
= NULL
;
797 /* This is called after the session scope and the user service were successfully created, and finishes where
798 * bus_manager_create_session() left off. */
800 if (!s
->create_message
)
803 if (!sd_bus_error_is_set(error
) && !session_ready(s
))
806 c
= TAKE_PTR(s
->create_message
);
808 return sd_bus_reply_method_error(c
, error
);
810 fifo_fd
= session_create_fifo(s
);
814 /* Update the session state file before we notify the client about the result. */
817 p
= session_bus_path(s
);
821 log_debug("Sending reply about created session: "
822 "id=%s object_path=%s uid=%u runtime_path=%s "
823 "session_fd=%d seat=%s vtnr=%u",
826 (uint32_t) s
->user
->user_record
->uid
,
827 s
->user
->runtime_path
,
829 s
->seat
? s
->seat
->id
: "",
832 return sd_bus_reply_method_return(
836 s
->user
->runtime_path
,
838 (uint32_t) s
->user
->user_record
->uid
,
839 s
->seat
? s
->seat
->id
: "",