GNU bug report logs - #11150
getlogin test failure

Previous Next

Package: coreutils;

Reported by: Matt Burgess <matthew <at> linuxfromscratch.org>

Date: Mon, 2 Apr 2012 00:11:02 UTC

Severity: normal

Merged with 12729

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

Bug is archived. No further changes may be made.

Full log


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

From: Pádraig Brady <P <at> draigBrady.com>
To: Jim Meyering <jim <at> meyering.net>
Cc: Andrew Warshall <warshall <at> 99main.com>, bug-gnulib <at> gnu.org,
	matthew <at> linuxfromscratch.org, 11150 <at> debbugs.gnu.org
Subject: Re: bug#11150: getlogin test failure
Date: Fri, 09 Nov 2012 15:01:32 +0000
On 08/13/2012 03:02 PM, Jim Meyering wrote:
> Andrew Warshall wrote:
>>     I'm seeing the same issue with 8.18. Apparently xterm doesn't write
>>     to /var/run/utmp by default, so getlogin () fails with errno ==
>>     ENOENT. However, isatty (0) still succeeds. The attached patch
>>     (based on, though not interchangeable with, the sed command at
>>     http://www.linuxfromscratch.org/lfs/view/development/chapter06/coreutils.html)
>>     skips the test under those conditions (at least it works on my
>>     machine). Of course, you could alternatively take the position that
>>     reliance on /var/run/utmp is a bug in getlogin () in gnulib; but
>>     then I don't know how to fix it.
>
> Thanks for the report and patch.
> I'm forwarding this to the bug-gnulib list
> since that is where this test is maintained.
>
>> --- gnulib-tests/test-getlogin.c.orig	2012-08-12 10:38:28.000000000 -0400
>> +++ gnulib-tests/test-getlogin.c	2012-08-12 10:39:06.000000000 -0400
>> @@ -42,9 +42,10 @@
>>         /* getlogin() fails when stdin is not connected to a tty.  */
>>         ASSERT (errno == ENOTTY
>>                 || errno == EINVAL /* seen on Linux/SPARC */
>> +	      || errno == ENOENT
>>                );
>>   #if !defined __hpux /* On HP-UX 11.11 it fails anyway.  */
>> -      ASSERT (! isatty (0));
>> +      ASSERT (errno == ENOENT || ! isatty (0));
>>   #endif
>>         fprintf (stderr, "Skipping test: stdin is not a tty.\n");
>>         return 77;
>
>

Fixed with:

http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=commit;h=4f81aa5
http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=commit;h=bfe5b0d

thanks,
Pádraig.




This bug report was last modified 12 years and 199 days ago.

Previous Next


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