Use getpwnam(getlogin()) before getpwuid(getuid())
This commit is contained in:
parent
263f4be35c
commit
eb8eee5a55
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user