return;
if (!s->timer_event_source)
- sd_event_add_monotonic(s->manager->event, &s->timer_event_source, now(CLOCK_MONOTONIC) + RELEASE_USEC, 0, release_timeout_callback, s);
+ sd_event_add_time(s->manager->event,
+ &s->timer_event_source,
+ CLOCK_MONOTONIC,
+ now(CLOCK_MONOTONIC) + RELEASE_USEC, 0,
+ release_timeout_callback, s);
}
bool session_is_active(Session *s) {
return 0;
}
-void session_mute_vt(Session *s) {
+void session_prepare_vt(Session *s) {
int vt, r;
struct vt_mode mode = { 0 };
sigset_t mask;
if (vt < 0)
return;
+ r = fchown(vt, s->user->uid, -1);
+ if (r < 0)
+ goto error;
+
r = ioctl(vt, KDSKBMODE, K_OFF);
if (r < 0)
goto error;
mode.mode = VT_AUTO;
ioctl(vt, VT_SETMODE, &mode);
+ fchown(vt, 0, -1);
+
s->vtfd = safe_close(s->vtfd);
}
* exits.
* If logind crashes/restarts, we restore the controller during restart
* or reset the VT in case it crashed/exited, too. */
- session_mute_vt(s);
+ session_prepare_vt(s);
return 0;
}
[SESSION_TTY] = "tty",
[SESSION_X11] = "x11",
[SESSION_WAYLAND] = "wayland",
+ [SESSION_MIR] = "mir",
};
DEFINE_STRING_TABLE_LOOKUP(session_type, SessionType);