From: Thorsten Kukuk <kukuk@suse.com>
To: "distributions@lists.linux.dev" <distributions@lists.linux.dev>
Subject: Re: Y2038, glibc and utmp/utmpx on 64bit architectures
Date: Fri, 3 Mar 2023 21:55:00 +0100 [thread overview]
Message-ID: <20230303205500.GA13773@suse.com> (raw)
In-Reply-To: <c420abff6abd43cabac8c2fa5d812091@DB6PR04MB3255.eurprd04.prod.outlook.com>
On Fri, Mar 03, Bruno Haible wrote:
> Thorsten Kukuk wrote:
> > > I really don’t think it is appropriate to outright remove POSIX standard
> > > interfaces from Linux, replacing them with non-standard systemd APIs.
> >
> > Nobody wants to remove the current utmp code (ok, not quite correct,
> > glibc developers plan to remove it from glibc, as it will stop working
> > in a few years) and feel free to convert all the code out there to use
> > the utmpx and not utmp interface.
>
> I don't understand: Do the glibc developers plan to remove the utmpx
> interface as well (together with utmp interface)?
In glibc, utmpx is just an alias for utmp.
> If yes, then
> - What is the point of your suggestion to "use the utmpx and not utmp
> interface", above?
utmps only supports the utmpx interface, not utmp. So if you want to use
utmps, you need to convert all source code to utmpx.
I did not recommend to use utmpx as this is with glibc identical with
utmp with exact the same problems.
> - Since there is no "FUTURE DIRECTIONS" in POSIX
> https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/functions/endutxent.html
> will the utmpx interface get deprecated in POSIX, or stay as it is?
> Is the Austin Group already involved?
Linux is not POSIX conform, never was and there was never the plan to
become, but it tries to be as compatible with POSIX as possible where
it makes sense. If it does not make sense, POSIX will not be used. You
should be able to find several examples in glibc, where interfaces
derivate slightly from POSIX because the POSIX interface didn't made any
sense.
Parts of POSIX are really old (don't know how old utmp/utmpx are, but
they did exist already since a long time before I started to work
with Unix, and that's really a long time ago) and things are changing.
Today, utmp/utmpx create more problems then it solve. Many features of
it where never used on Linux or are meanwhile no longer used, at least
not with systemd.
There is just no benefit from it anymore. But on the other side, all the
problems with utmp/utmpx stay. Like the need for applications with
special rights to write to that file, which is security wise a
nightmare. Especially if that is an X11 application.
Or the format, a string can be nul terminated, or be as long as the
field. It's a nightmare to parse such entries in a secure way and often done
wrong.
Or the limitation of the length of the username, which creates regular
bug reports by users, which don't understand this limitation. Which is
only there because of utmp, the full rest of the system does not have
such a limitation of the username.
If somebody really needs a POSIX conform utmpx implementation for Linux:
I'm pretty sure that it is no problem to create a library where the
functions fetches the data from logind and not a file, like utmps is
doing. But he need to be aware: such an interface will introduce all the
useless limitations and problems of utmp/utmpx again.
Thorsten
--
Thorsten Kukuk, Distinguished Engineer, Senior Architect, Future Technologies
SUSE Software Solutions Germany GmbH, Frankenstraße 146, 90461 Nuernberg, Germany
Managing Director: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman
(HRB 36809, AG Nürnberg)
next prev parent reply other threads:[~2023-03-03 20:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-03 10:46 Y2038, glibc and utmp/utmpx on 64bit architectures Thorsten Kukuk
2023-03-03 16:51 ` A. Wilcox
[not found] ` <3067bd0ec5134b039cdb8be9db8da8e5@DB6PR04MB3255.eurprd04.prod.outlook.com>
2023-03-03 17:07 ` Thorsten Kukuk
2023-03-03 20:09 ` Anna
2023-03-03 20:25 ` Bruno Haible
[not found] ` <c420abff6abd43cabac8c2fa5d812091@DB6PR04MB3255.eurprd04.prod.outlook.com>
2023-03-03 20:55 ` Thorsten Kukuk [this message]
2023-03-03 22:11 ` Bruno Haible
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=20230303205500.GA13773@suse.com \
--to=kukuk@suse.com \
--cc=distributions@lists.linux.dev \
/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