GNU bug report logs - #76876
logname output is often wrong when linked with glibc

Previous Next

Package: coreutils;

Reported by: Nicolas Boos <nicolas.boos <at> wanadoo.fr>

Date: Sat, 8 Mar 2025 23:08:03 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 76876 <at> debbugs.gnu.org (full text, mbox):

From: Bruno Haible <bruno <at> clisp.org>
To: Nicolas Boos <nicolas.boos <at> wanadoo.fr>, bug-gnulib <at> gnu.org,
 Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 76876 <at> debbugs.gnu.org
Subject: Re: bug#76876: logname output is often wrong when linked with glibc
Date: Sun, 09 Mar 2025 10:23:02 +0100
[Message part 1 (text/plain, inline)]
Paul Eggert wrote:
> In the meantime I installed the attached to Gnulib, to 
> document the incompatibility, which also occurs with getlogin_r.

These two patches actually work around the bugs.

With this, coreutils should be fine, since it already imports the 'getlogin'
module from gnulib.


2025-03-09  Bruno Haible  <bruno <at> clisp.org>

	getlogin_r: Work around musl bug.
	* lib/getlogin_r.c (getlogin_r): Add implementation for Linux.
	* m4/getlogin_r.m4 (gl_FUNC_GETLOGIN_R): Test whether getlogin_r has the
	musl bug.
	* tests/test-getlogin_r.c (main): Add another test.
	* doc/posix-functions/getlogin_r.texi: Mention the workaround.

2025-03-09  Bruno Haible  <bruno <at> clisp.org>

	getlogin: Work around musl bug.
	* lib/unistd.in.h (getlogin): Consider REPLACE_GETLOGIN.
	* lib/getlogin.c: Change license header to GPL.
	(getlogin): Add implementation for Linux.
	* m4/getlogin.m4 (gl_FUNC_GETLOGIN): Test whether getlogin works.
	* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize REPLACE_GETLOGIN.
	* modules/unistd-h (Makefile.am): Substitute REPLACE_GETLOGIN.
	* modules/getlogin (Depends-on): Add readutmp.
	(configure.ac): Consider REPLACE_GETLOGIN.
	(License): Change to GPL.
	* tests/test-getlogin.c (main): Add another test.
	* doc/posix-functions/getlogin.texi: Mention the workaround.

[0001-getlogin-Work-around-musl-bug.patch (text/x-patch, attachment)]
[0002-getlogin_r-Work-around-musl-bug.patch (text/x-patch, attachment)]

This bug report was last modified 116 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.