Paul Eggert <[email protected]> writes:

> On 2026-04-18 15:40, Arsen Arsenović wrote:
>> Paul Eggert <[email protected]> writes:
>> 
>>> On 2026-04-18 11:29, Collin Funk wrote:
>>>
>>>> The issue I have with this solution is that it requires the 'who'
>>>> program to maintain an ever expanding list of user names used by desktop
>>>> managers.
>>>
>>> Maybe filter them out if their login shell ends in "/nologin"?
>>>
>>>> Also, I guess this is mostly theoretical, but you would want to show
>>>> 'gdm-greeter' if a user actually named themselves that.
>>>
>>> The "/nologin" hack should work in that weird case.
>> Why not check for class == user?
>
> Oh, I never knew about sd_session_get_class. Yes, it sounds like Gnulib's
> readutmp.c should use this function to filter out bogus entries.
>
>
>
>> There's clearly already attempts to do this in the code, so it's worth
>> debugging what goes wrong there.  Sorry if I'm missing something
>> obvious.
>
> Currently the Gnulib code checks only for class being "manager". I wonder why
> it does that? Anyway, it appears that 'who' should output only "user" entries.

Per
https://github.com/systemd/systemd/blob/809a4139a60f17bc7b5bcffb81ba3a83d2cbefec/src/login/logind-session.h#L18-L33
there appear to be a few classes of users based on whether they're set
up and when they're created (corresponding identifiers are in
https://github.com/systemd/systemd/blob/809a4139a60f17bc7b5bcffb81ba3a83d2cbefec/src/login/logind-session.c#L1703
); maybe those should be considered also.

But, yes, that seems correct to me also.
-- 
Arsen Arsenović

Attachment: signature.asc
Description: PGP signature

Reply via email to