]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind: save seat before applying acl
authorxinpeng wang <wangxinpeng@uniontech.com>
Mon, 17 Feb 2025 07:01:22 +0000 (15:01 +0800)
committerLennart Poettering <lennart@poettering.net>
Wed, 19 Feb 2025 15:38:33 +0000 (16:38 +0100)
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.

src/login/logind-seat.c

index bed1f7db031f30da52beeeabb66ff9068989fbb4..50c2b21b47eca18909289ccd3d3d289d07a1cecd 100644 (file)
@@ -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);
@@ -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);