express: Check getenv(LOGNAME) for user name first before using getlogin()

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2015-04-13 10:02:14 -04:00
parent 4f79bcfa79
commit cd06d81420
1 changed files with 2 additions and 1 deletions

View File

@ -108,7 +108,8 @@ _util_user_fullname_get(void)
struct passwd *p;
size_t n;
if (!(usr = getlogin())) return NULL;
if (!(usr = getenv("LOGNAME")))
if (!(usr = getlogin())) return NULL;
p = getpwnam(usr);
if ((!p) && (errno == 0)) return NULL;