GNU bug report logs -
#18386
logname fails with error "logname: no login name" (is there an echo in here)
Previous Next
Reported by: Linda Walsh <coreutils <at> tlinx.org>
Date: Tue, 2 Sep 2014 00:08:01 UTC
Severity: normal
Tags: notabug
Done: Assaf Gordon <assafgordon <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 18386 <at> debbugs.gnu.org (full text, mbox):
On 09/02/2014 02:06 AM, Linda Walsh wrote:
>> logname
> logname: no login name
logname(1) works here on a regular openSUSE-13.1 system, and
just calls getlogin(3) to get the information as required:
$ ltrace logname
...
getlogin() = "berny"
which in turn seems to retrieve the information like this:
$ strace logname
...
open("/proc/self/loginuid", O_RDONLY) = 3
read(3, "717", 12) = 3
close(3) = 0
socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_LOCAL, sun_path="/var/run/nscd/socket"}, 110) = 0
sendto(3, "\2\0\0\0\v\0\0\0\7\0\0\0passwd\0", 19, MSG_NOSIGNAL, NULL, 0) = 19
...
Don't you have /proc mounted?
> Ishtar:/> who -a
> Ishtar:/> who -t
> Ishtar:/> who -u
> Ishtar:/> who -b
> Linux Ishtar 3.16.0-Isht-Van #1 SMP PREEMPT Tue Aug 12 11:11:02 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux
>
> I wonder if the who command's output being broken is related?
Similar for who(1) here:
$ strace who
...
open("/var/run/utmp", O_RDONLY|O_CLOEXEC) = 3
...
> Distro is a 13.1 SuSE base, but wouldn't call it a stock system (still boots w/sysvinit)
It looks like trying to avoid systemd is not that easy ...
Have a nice day,
Berny
This bug report was last modified 6 years and 299 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.