This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/19978] New: [glibc] getlogin() returns user name 'NULL'
- From: "jfrieben at hotmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 21 Apr 2016 12:37:39 +0000
- Subject: [Bug libc/19978] New: [glibc] getlogin() returns user name 'NULL'
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=19978
Bug ID: 19978
Summary: [glibc] getlogin() returns user name 'NULL'
Product: glibc
Version: 2.23
Status: NEW
Severity: normal
Priority: P2
Component: libc
Assignee: unassigned at sourceware dot org
Reporter: jfrieben at hotmail dot com
CC: drepper.fsp at gmail dot com
Target Milestone: ---
This bug was originally reported as
https://bugzilla.redhat.com/show_bug.cgi?id=1328947.
Using the sample code from
https://bugzilla.redhat.com/show_bug.cgi?id=621959#c0, namely
----
#include <unistd.h>
#include <stdio.h>
int main(int argc, char **argv)
{
char *username = getlogin();
printf("[%s]\n", username);
return 0;
}
----
It turns out that the getlogin() call in Fedora 24 which features the current
glibc 2.23 erroneously returns the user name 'NULL' whereas in Fedora 23 which
has glibc 2.22, it returns the actual user name. Also Ubuntu 16.04 LTS exhibits
this issue which thus appears to be generic.
On both systems, running the executable 'test*' leads to the following output:
$ ./test
[(null)]
--
You are receiving this mail because:
You are on the CC list for the bug.