From 54ef9263d2fc42412359e5ab247b9c8bd6c2abb8 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 27 Aug 2024 11:46:33 +0200 Subject: [PATCH] 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. --- ChangeLog | 8 ++++++++ lib/readutmp.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8f797b0053..e67b41fa6b 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, -- 2.39.5