Skip to content

Commit

Permalink
logind: save seat before applying acl
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
xinpeng wang authored and poettering committed Feb 19, 2025
1 parent 6750629 commit df1ff1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/login/logind-seat.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ int seat_set_active(Seat *s, Session *session) {
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);
Expand All @@ -257,8 +259,6 @@ int seat_set_active(Seat *s, Session *session) {
if (!session || session->started)
seat_send_changed(s, "ActiveSession", NULL);

seat_save(s);

if (session) {
session_save(session);
user_save(session->user);
Expand Down

0 comments on commit df1ff1c

Please sign in to comment.