1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-11 09:51:56 +02:00

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.
* bootstrap.conf (gnulib_modules): Add str_endswith.
* News: Mention the bug fix.
Addresses https://bugzilla.redhat.com/2343998
This commit is contained in:
Lukáš Zaoral
2025-02-24 10:36:35 +01:00
committed by Pádraig Brady
parent 0a03735c71
commit 24450e5eec
3 changed files with 6 additions and 1 deletions

4
NEWS
View File

@@ -14,6 +14,10 @@ GNU coreutils NEWS -*- outline -*-
'ls -Z dir' would crash.
[bug introduced in coreutils-9.6]
'who -m' now outputs entries for remote logins. Previously login
entries prefixed with the service (like "sshd") were not matched.
[bug introduced in coreutils-9.4]
* Noteworthy changes in release 9.6 (2025-01-17) [stable]

View File

@@ -253,6 +253,7 @@ gnulib_modules="
stdckdint-h
stdlib-safer
stpcpy
str_endswith
strdup-posix
strnlen
strnumcmp

View File

@@ -577,7 +577,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);