On 2026-04-19 00:54, Arsen Arsenović wrote:
But, yes, that seems correct to me also.

Thanks for the comments. I installed the attached and plan to propagate this into coreutils shortly.
From f5351961e1724e6bb73eab30f4965d857941aaa6 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Sun, 19 Apr 2026 11:12:16 -0700
Subject: [PATCH] readutmp: greeters are not users

* lib/readutmp.c (read_utmp_from_systemd):
Do not merely treat a "manager*" class as a login process.
Instead, treat all non-"user*" processes as login processes.
With current systemd, this changes the treatment of "greeter",
"lock-screen", "background", "background-light", and "none"
classes so that they are now considered to be login processes, not
user processes.
---
 ChangeLog      | 11 +++++++++++
 lib/readutmp.c |  5 ++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 96f180c446..5d37f29278 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2026-04-19  Paul Eggert  <[email protected]>
+
+	readutmp: greeters are not users
+	* lib/readutmp.c (read_utmp_from_systemd):
+	Do not merely treat a "manager*" class as a login process.
+	Instead, treat all non-"user*" processes as login processes.
+	With current systemd, this changes the treatment of "greeter",
+	"lock-screen", "background", "background-light", and "none"
+	classes so that they are now considered to be login processes, not
+	user processes.
+
 2026-04-19  Jim Meyering  <[email protected]>
 
 	regex: avoid a UBSAN failure: remove an unnecessary DEBUG_ASSERT
diff --git a/lib/readutmp.c b/lib/readutmp.c
index 14293f4006..7320c4cbed 100644
--- a/lib/readutmp.c
+++ b/lib/readutmp.c
@@ -888,9 +888,8 @@ read_utmp_from_systemd (idx_t *n_entries, STRUCT_UTMP **utmp_buf, int options)
                   char *clasz;
                   if (sd_session_get_class (session, &clasz) < 0)
                     clasz = missing;
-                  short ctype =
-                    (strncmp (clasz, "manager", 7) == 0 ? LOGIN_PROCESS :
-                     USER_PROCESS);
+                  short ctype = (strncmp (clasz, "user", 4) == 0
+                                 ? USER_PROCESS : LOGIN_PROCESS);
 
                   char *host;
                   char *remote_host;
-- 
2.51.0

Reply via email to