Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/passwd.cc')
-rw-r--r--winsup/cygwin/passwd.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/winsup/cygwin/passwd.cc b/winsup/cygwin/passwd.cc
index 8c51c22a0..23756241a 100644
--- a/winsup/cygwin/passwd.cc
+++ b/winsup/cygwin/passwd.cc
@@ -66,7 +66,8 @@ pwdgrp::read_passwd ()
if (!user_shared->cb || myself->uid == ILLEGAL_UID)
searchentry = !internal_getpwsid (tu);
if (searchentry
- && (!(pw = internal_getpwnam (cygheap->user.name ()))
+ && (!cygheap->user.name ()
+ || !(pw = internal_getpwnam (cygheap->user.name ()))
|| !user_shared->cb
|| (myself->uid != ILLEGAL_UID
&& myself->uid != (__uid32_t) pw->pw_uid
@@ -75,7 +76,7 @@ pwdgrp::read_passwd ()
static char linebuf[1024]; // must be static and
// should not be NO_COPY
snprintf (linebuf, sizeof (linebuf), "%s:*:%lu:%lu:,%s:%s:/bin/sh",
- cygheap->user.name (),
+ cygheap->user.name () ?: "",
(!user_shared->cb || myself->uid == ILLEGAL_UID)
? UNKNOWN_UID : myself->uid,
!user_shared->cb ? UNKNOWN_GID : myself->gid,