Use getpwnam(getlogin()) before getpwuid(getuid())

This commit is contained in:
Andrey A. Chernov 1997-08-27 13:36:34 +00:00
parent 263f4be35c
commit eb8eee5a55

View File

@ -363,10 +363,12 @@ globtilde(pattern, patbuf, patbuf_len, pglob)
* the password file
*/
if (issetugid() != 0 || (h = getenv("HOME")) == NULL) {
if ((pwd = getpwuid(getuid())) == NULL)
return pattern;
else
if (((h = getlogin()) != NULL &&
(pwd = getpwnam(h)) != NULL) ||
(pwd = getpwuid(getuid())) != NULL)
h = pwd->pw_dir;
else
return pattern;
}
}
else {