udev will trigger the uaccess program in 73-seat-late.rules, which
may modify the device's acl permissions. In some cases, udev triggers
the uaccess program when logind is started and active is being set.
At this time, 1) logind sets the user's acl permissions, 2) uaccess
obtains active and sets acl permissions; 3) logind updates seat's
stat_file and writes active. This situation will cause the device to
not have the correct acl permissions, resulting in abnormal situations
such as a black screen. Therefore, it is necessary to write active to
seat's stat file before setting acl.
old_active = s->active;
s->active = session;
+ seat_save(s);
+
if (old_active) {
session_device_pause_all(old_active);
session_send_changed(old_active, "Active", NULL);
if (!session || session->started)
seat_send_changed(s, "ActiveSession", NULL);
- seat_save(s);
-
if (session) {
session_save(session);
user_save(session->user);