diff options
Diffstat (limited to 'winsup/cygwin/uinfo.cc')
-rw-r--r-- | winsup/cygwin/uinfo.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index f445649b6..8dec58e66 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -61,20 +61,21 @@ internal_getlogin (cygheap_user &user) from the Windows user name */ if (ret) { - if ((pw = internal_getpwsid (tu))) - user.set_name (pw->pw_name); + pw = internal_getpwsid (tu); /* Set token owner to the same value as token user */ if (!SetTokenInformation (ptok, TokenOwner, &tu, sizeof tu)) debug_printf ("SetTokenInformation(TokenOwner): %E"); } } - if (!pw && !(pw = getpwnam (user.name ()))) - debug_printf("user name not found in augmented /etc/passwd"); + if (!pw && !(pw = getpwnam (user.name ())) + && !(pw = getpwuid32 (DEFAULT_UID))) + debug_printf("user not found in augmented /etc/passwd"); else { myself->uid = pw->pw_uid; myself->gid = pw->pw_gid; + user.set_name (pw->pw_name); if (wincap.has_security ()) { cygsid gsid; |