`gnuwho` command is broken in gnu-coreutils

Bug #2131703 reported by Eugene Crosser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apparmor (Ubuntu)
New
Undecided
Unassigned
coreutils (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Command "who" displays the list of users with open interactive sessions on the host:

Ubuntu 24.04.3 LTS:
$ who
crosser pts/0 2025-11-17 22:10 (2a02:8106:1:6801:e2a5:4c6b:50c8:c67f)

Raspbian GNU/Linux 12 (bookworm):
$ who
crosser pts/0 668814970213820297 (172.27.72.9)
crosser pts/1 668814970212950818 (172.27.72.9)

Armbian Debian stable (trixie):
$ who
crosser sshd pts/0 2025-11-17 22:13 (172.27.72.9)

However on questing, "who" displays nothing.

Questing and trixie do not have utmp file, but both have systemd libraries and should be build with enabled READUTMP_USE_SYSTEMD. It appears to be working fine on trixie. But it appears to not be working on questing. I verified that a simple C program that calls `sd_get_sessions()` and enumerates the result does get all correct information about logged in users.

ProblemType: Bug
DistroRelease: Ubuntu 25.10
Package: rust-coreutils 0.2.2-0ubuntu2.1
ProcVersionSignature: Ubuntu 6.17.0-6.6-generic 6.17.1
Uname: Linux 6.17.0-6-generic x86_64
ApportVersion: 2.33.1-0ubuntu3
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Mon Nov 17 22:08:47 2025
SourcePackage: rust-coreutils
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Eugene Crosser (crosser) wrote :
Revision history for this message
Eugene Crosser (crosser) wrote :

apt source gnu-coreutils
cd coreutils-9.5
sudo apt build-dep .
dpkg-buildpackage -uc -b

results in _working_ who! While the version installed from the binary package does not work:

crosser@pccross:/import/src/coreutils-9.5$ gnuwho
crosser@pccross:/import/src/coreutils-9.5$ src/who
crosser seat0 2025-11-17 19:19
crosser tty2 2025-11-17 19:19

Revision history for this message
Nick Rosbrook (enr0n) wrote :

We addressed this in GNU coreutils early in the 25.10 cycle, and backported a fix to 25.04: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2103489

However, it does appear that GNU coreutils in 25.10 and 26.04 (devel) has regressed.

tags: added: rls-qq-incoming rls-rr-incoming
Changed in coreutils (Ubuntu):
status: New → Confirmed
tags: added: dcr-incoming
Revision history for this message
Eugene Crosser (crosser) wrote :

@enr0n, it seems to me that (at least gnu-coreutils) version is built with systemd support, but is prevented from reading systemd session data by apparmor:

ration="open" class="file" profile="who" name="/run/systemd/sessions/c2" pid=25610 comm="gnuwho" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 9990.466693] audit: type=1400 audit(1763500930.781:306): apparmor="DENIED" operation="open" class="file" profile="who" name="/run/systemd/sessions/c2" pid=25610 comm="gnuwho" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 9990.466703] audit: type=1400 audit(1763500930.781:307): apparmor="DENIED" operation="open" class="file" profile="who" name="/run/systemd/sessions/1" pid=25610 comm="gnuwho" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 9990.466710] audit: type=1400 audit(1763500930.781:308): apparmor="DENIED" operation="open" class="file" profile="who" name="/run/systemd/sessions/1" pid=25610 comm="gnuwho" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

Revision history for this message
Eugene Crosser (crosser) wrote :

On the other hand, who from rust-coreutils is _not_ configured with systemd support, as far as I can see. It does try to open /var/run/utmp, and does _not_ try to open anything under /run/systemd/sessions.

So it looks like two independent problems exist here :)

Revision history for this message
Julian Andres Klode (juliank) wrote :

The rust-coreutils bug is tracked in 2117771; re-using this for the AppArmor issue with gnuwho.

no longer affects: rust-coreutils (Ubuntu)
summary: - `who` command is broken in both gnu-coreutils and rust-coreutils
+ `gnuwho` command is broken in gnu-coreutils
Ryan Lee (rlee287)
tags: added: sec-8109
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.