summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/passwd.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/passwd.cc')
-rw-r--r--winsup/cygwin/passwd.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/passwd.cc b/winsup/cygwin/passwd.cc
index 62b2955a0..797fb5375 100644
--- a/winsup/cygwin/passwd.cc
+++ b/winsup/cygwin/passwd.cc
@@ -19,6 +19,7 @@ details. */
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
+#include "cygheap.h"
#include <sys/termios.h>
/* Read /etc/passwd only once for better performance. This is done
@@ -179,7 +180,7 @@ search_for (uid_t uid, const char *name)
request for the current user. */
if (passwd_state != loaded
|| (!name && uid == myself->uid)
- || (name && strcasematch(name, myself->username)))
+ || (name && strcasematch(name, cygheap->user.name ())))
return default_pw;
return NULL;