From: Florian Weimer <fweimer@redhat.com>
To: Thorsten Kukuk via Libc-alpha <libc-alpha@sourceware.org>
Cc: Thorsten Kukuk <kukuk@suse.com>
Subject: Re: 64-bit time_t and __WORDSIZE_TIME64_COMPAT32
Date: Tue, 14 Feb 2023 09:59:59 +0100 [thread overview]
Message-ID: <873578bp0w.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20230214082409.GA29974@suse.com> (Thorsten Kukuk via Libc-alpha's message of "Tue, 14 Feb 2023 09:24:09 +0100")
* Thorsten Kukuk via Libc-alpha:
> I think we don't lose anything if btmp and lastlog don't exist anymore.
> Querying utmp for the runlevel in systemd times is also obsolete.
> Statistical data how many users are logged in if you login or if you
> call uptime is also only nice to have, nothing more.
This is something that systemd could do, in a far more reliable fashion
(or the kernel audit subsystem, I assume).
> So the main consumer of utmp is glibc itself: getlogin()/getlogin_r()
> Is there any idea how to replace that, if utmp/wtmp gets deprecated?
We use /proc/self/loginuid already, and try to resolve that UID using
NSS. We still have fallback to __getutline_r. I think it would be
really helpful if you could discover why that fallback is used. I would
have thought it's dead code.
Is it because /proc/self/loginuid is missing, or because NSS fails for
some reason? If it's about /proc/self/loginuid, maybe we can look at
the owner of /dev/tty instead.
> That's the only use case for which I don't see an alternate currently.
> The musl libc way to use an environment variable is really not safe...
The manual page has strong guidance that getlogin is not to be trusted.
/proc/self/loginuid is probably quite hard to fool, though, but the
fallback code is another matter.
> Another real usecase is to find the TTYs for wall and wall alike
> messages by tools like shutdown, systemd and similar.
Again, this seems to be more in the realm of the init service.
> Functions like login()/logout() are only used by openssh. So should be
> solveable, too.
Also FTP servers. But we have seen quite a few problems due to account
database updates because the data structure isn't great, and isn't
really suitable to handling PTYs.
Thanks,
Florian
next prev parent reply other threads:[~2023-02-14 9:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-08 9:18 Thorsten Kukuk
2023-02-08 10:06 ` Andreas Schwab
[not found] ` <0869a6f98f29405eb431f63db593c490@DB6PR04MB3255.eurprd04.prod.outlook.com>
2023-02-08 10:11 ` Thorsten Kukuk
2023-02-08 10:17 ` Andreas Schwab
[not found] ` <d2f1ee273add4af0868e07dc32542687@DB6PR04MB3255.eurprd04.prod.outlook.com>
2023-02-08 10:22 ` Thorsten Kukuk
2023-02-08 10:27 ` Andreas Schwab
[not found] ` <7485b79473614eaa994d3ea79c91629a@DB6PR04MB3255.eurprd04.prod.outlook.com>
2023-02-08 10:38 ` Thorsten Kukuk
2023-02-08 11:48 ` Adhemerval Zanella Netto
2023-02-14 8:24 ` Thorsten Kukuk
2023-02-14 8:59 ` Florian Weimer [this message]
[not found] ` <3230d2f8fa214c268cba52e699c14ae2@DB6PR04MB3255.eurprd04.prod.outlook.com>
2023-02-14 9:26 ` Thorsten Kukuk
2023-02-14 14:28 ` Adhemerval Zanella Netto
2023-02-16 13:59 ` Thorsten Kukuk
2023-04-11 11:40 ` Thorsten Kukuk
2023-04-11 13:23 ` Adhemerval Zanella Netto
2023-09-25 7:30 ` Thorsten Kukuk
2023-04-11 21:41 ` Paul Eggert
2023-04-12 6:55 ` Thorsten Kukuk
2023-04-12 23:36 ` Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=873578bp0w.fsf@oldenburg.str.redhat.com \
--to=fweimer@redhat.com \
--cc=kukuk@suse.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).