]> Savannah Git Hosting - gnulib.git/commitdiff
readutmp: In systemd mode, show sessions of type "web".
authorBruno Haible <bruno@clisp.org>
Tue, 27 Aug 2024 09:46:33 +0000 (11:46 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 27 Aug 2024 09:46:33 +0000 (11:46 +0200)
Reported by Allison Karlitskaya <allison.karlitskaya@redhat.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-08/msg00160.html>.

* lib/readutmp.c (read_utmp_from_systemd): For a systemd session of type
"web", add a single USER_PROCESS entry.

ChangeLog
lib/readutmp.c

index c9bccf683960190718d628adb0224e444b6725f3..6c9199b79eb2cd2c764510505afe5afcf60743cb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-08-27  Bruno Haible  <bruno@clisp.org>
+
+       readutmp: In systemd mode, show sessions of type "web".
+       Reported by Allison Karlitskaya <allison.karlitskaya@redhat.com> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2024-08/msg00160.html>.
+       * lib/readutmp.c (read_utmp_from_systemd): For a systemd session of type
+       "web", add a single USER_PROCESS entry.
+
 2024-08-26  Bruno Haible  <bruno@clisp.org>
 
        Fix a test failure from a clang that masquerades as gcc 13.
index 10d79d1d81a5eeb9da7cbfcc72f214430abcfa2c..3c4f97b146fa79f6aae9b3fa298b0e13eb69d34b 100644 (file)
@@ -867,6 +867,14 @@ read_utmp_from_systemd (idx_t *n_entries, STRUCT_UTMP **utmp_buf, int options)
                       else if (pty != NULL)
                         tty = pty;
                     }
+                  else if (strcmp (type, "web") == 0)
+                    {
+                      char *service;
+                      if (sd_session_get_service (session, &service) < 0)
+                        service = NULL;
+
+                      tty = service;
+                    }
                 }
 
               /* Create up to two USER_PROCESS entries: one for the seat,