mirror of
https://github.com/opnsense/src.git
synced 2026-06-10 17:22:46 -04:00
Use getpwnam(getlogin()) before getpwuid(getuid())
This commit is contained in:
parent
263f4be35c
commit
eb8eee5a55
1 changed files with 5 additions and 3 deletions
|
|
@ -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 a new issue