From: Bruno Haible Date: Tue, 27 Aug 2024 09:46:33 +0000 (+0200) Subject: readutmp: In systemd mode, show sessions of type "web". X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=43f7f428a1665950233557bd97611bd5e996b5cb;p=gnulib.git readutmp: In systemd mode, show sessions of type "web". Reported by Allison Karlitskaya in . * lib/readutmp.c (read_utmp_from_systemd): For a systemd session of type "web", add a single USER_PROCESS entry. --- diff --git a/ChangeLog b/ChangeLog index c9bccf6839..6c9199b79e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2024-08-27 Bruno Haible + + readutmp: In systemd mode, show sessions of type "web". + Reported by Allison Karlitskaya in + . + * 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 Fix a test failure from a clang that masquerades as gcc 13. diff --git a/lib/readutmp.c b/lib/readutmp.c index 10d79d1d81..3c4f97b146 100644 --- a/lib/readutmp.c +++ b/lib/readutmp.c @@ -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,