Zbigniew Jędrzejewski-Szmek f4a676
From 5dd32bbe8c4cb06df63cadb7e40ecd92997f001d Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek f4a676
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Zbigniew Jędrzejewski-Szmek f4a676
Date: Thu, 18 May 2017 20:58:23 -0400
Zbigniew Jędrzejewski-Szmek f4a676
Subject: [PATCH] sd-login: read list of uids of sessions from UIDS not
Zbigniew Jędrzejewski-Szmek f4a676
 ACTIVE_SESSIONS
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
As described by Luke Shumaker:
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
  sd_seat_get_sessions looks at /run/systemd/seats/${seat_name}:SESSIONS to get
Zbigniew Jędrzejewski-Szmek f4a676
  the list of sessions (which I believe is correct), and at
Zbigniew Jędrzejewski-Szmek f4a676
  /run/systemd/seats/${seat_name}:ACTIVE_SESSIONS for the list of users (which
Zbigniew Jędrzejewski-Szmek f4a676
  I believe is incorrect); I believe that it should look at the UIDS field for
Zbigniew Jędrzejewski-Szmek f4a676
  the list of users. As far as I can tell, the ACTIVE_SESSIONS field is never
Zbigniew Jędrzejewski-Szmek f4a676
  even present in the seats file. I also believe that this has been broken
Zbigniew Jędrzejewski-Szmek f4a676
  since the function was first committed almost 6 years ago.
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
Fixes #5743.
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
(cherry picked from commit d3cfab3148de482649e22d9dbbfec6e967a80856)
Zbigniew Jędrzejewski-Szmek f4a676
---
Zbigniew Jędrzejewski-Szmek f4a676
 src/libsystemd/sd-login/sd-login.c | 2 +-
Zbigniew Jędrzejewski-Szmek f4a676
 1 file changed, 1 insertion(+), 1 deletion(-)
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
diff --git a/src/libsystemd/sd-login/sd-login.c b/src/libsystemd/sd-login/sd-login.c
Zbigniew Jędrzejewski-Szmek f4a676
index d2cfbdf5b0..cdbdc37856 100644
Zbigniew Jędrzejewski-Szmek f4a676
--- a/src/libsystemd/sd-login/sd-login.c
Zbigniew Jędrzejewski-Szmek f4a676
+++ b/src/libsystemd/sd-login/sd-login.c
Zbigniew Jędrzejewski-Szmek f4a676
@@ -687,7 +687,7 @@ _public_ int sd_seat_get_sessions(const char *seat, char ***sessions, uid_t **ui
Zbigniew Jędrzejewski-Szmek f4a676
 
Zbigniew Jędrzejewski-Szmek f4a676
         r = parse_env_file(p, NEWLINE,
Zbigniew Jędrzejewski-Szmek f4a676
                            "SESSIONS", &s,
Zbigniew Jędrzejewski-Szmek f4a676
-                           "ACTIVE_SESSIONS", &t,
Zbigniew Jędrzejewski-Szmek f4a676
+                           "UIDS", &t,
Zbigniew Jędrzejewski-Szmek f4a676
                            NULL);
Zbigniew Jędrzejewski-Szmek f4a676
         if (r == -ENOENT)
Zbigniew Jędrzejewski-Szmek f4a676
                 return -ENXIO;