mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-25 22:40:05 +00:00
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.
This commit is contained in:
parent
24cdd6c71d
commit
0d83b349fa
@ -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
|
value of, (uid_t) -1, so check if that value is set and return early to
|
||||||
avoid making unneeded nss lookups. */
|
avoid making unneeded nss lookups. */
|
||||||
if (uid == (uid_t) -1)
|
if (uid == (uid_t) -1)
|
||||||
{
|
return -1;
|
||||||
__set_errno (ENXIO);
|
|
||||||
return ENXIO;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct passwd pwd;
|
struct passwd pwd;
|
||||||
struct passwd *tpwd;
|
struct passwd *tpwd;
|
||||||
|
Loading…
Reference in New Issue
Block a user