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


View this message in rfc822 format

From: Jim Meyering <jim <at> meyering.net>
To: Andrew Warshall <warshall <at> 99main.com>
Cc: bug-gnulib <at> gnu.org, matthew <at> linuxfromscratch.org, 11150 <at> debbugs.gnu.org
Subject: bug#11150: getlogin test failure
Date: Mon, 13 Aug 2012 16:02:22 +0200
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;




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.