25 lines
909 B
Diff
25 lines
909 B
Diff
From 24450e5eecf012bc1ea8cab8d677a45fa42c1778 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= <lzaoral@redhat.com>
|
|
Date: Mon, 24 Feb 2025 10:36:35 +0100
|
|
Subject: who: fix -m with guessed tty names
|
|
|
|
* who.c (scan_entries): Account for guessed tty names (e.g.
|
|
'sshd pts/1') from the readutmp module when using the systemd backend.
|
|
Addresses https://bugzilla.redhat.com/2343998
|
|
---
|
|
src/who.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/src/who.c b/src/who.c
|
|
index b56a1ac..17c1e34 100644
|
|
--- a/src/who.c
|
|
+++ b/src/who.c
|
|
@@ -583,7 +583,7 @@ scan_entries (idx_t n, struct gl_utmp const *utmp_buf)
|
|
while (n--)
|
|
{
|
|
if (!my_line_only
|
|
- || STREQ (ttyname_b, utmp_buf->ut_line))
|
|
+ || str_endswith (utmp_buf->ut_line, ttyname_b))
|
|
{
|
|
if (need_users && IS_USER_PROCESS (utmp_buf))
|
|
print_user (utmp_buf, boottime);
|