public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] getlogin_r: fix missing fallback if loginuid is unset (bug 30235)
@ 2023-03-30 11:58 Andreas Schwab
0 siblings, 0 replies; only message in thread
From: Andreas Schwab @ 2023-03-30 11:58 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0d83b349fa7340475406b2fe933c7467e4584091
commit 0d83b349fa7340475406b2fe933c7467e4584091
Author: Andreas Schwab <schwab@suse.de>
Date: Wed Mar 15 11:44:24 2023 +0100
getlogin_r: fix missing fallback if loginuid is unset (bug 30235)
When /proc/self/loginuid is not set, we should still fall back to using
the traditional utmp lookup, instead of failing right away.
Diff:
---
sysdeps/unix/sysv/linux/getlogin_r.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/getlogin_r.c b/sysdeps/unix/sysv/linux/getlogin_r.c
index 879df85a16..4ae9a53503 100644
--- a/sysdeps/unix/sysv/linux/getlogin_r.c
+++ b/sysdeps/unix/sysv/linux/getlogin_r.c
@@ -59,10 +59,7 @@ __getlogin_r_loginuid (char *name, size_t namesize)
value of, (uid_t) -1, so check if that value is set and return early to
avoid making unneeded nss lookups. */
if (uid == (uid_t) -1)
- {
- __set_errno (ENXIO);
- return ENXIO;
- }
+ return -1;
struct passwd pwd;
struct passwd *tpwd;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-30 11:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-30 11:58 [glibc] getlogin_r: fix missing fallback if loginuid is unset (bug 30235) Andreas Schwab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).