diff options
Diffstat (limited to 'winsup/cygwin/passwd.cc')
-rw-r--r-- | winsup/cygwin/passwd.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/winsup/cygwin/passwd.cc b/winsup/cygwin/passwd.cc index 5dd871234..1a6654c21 100644 --- a/winsup/cygwin/passwd.cc +++ b/winsup/cygwin/passwd.cc @@ -82,7 +82,8 @@ pwdgrp::read_passwd () myself->uid != (__uid32_t) pw->pw_uid && !internal_getpwuid (myself->uid)))) { - static char NO_COPY linebuf[1024]; // must be static + static char linebuf[1024]; // must be static and + // should not be NO_COPY (void) cygheap->user.ontherange (CH_HOME, NULL); snprintf (linebuf, sizeof (linebuf), "%s:*:%lu:%lu:,%s:%s:/bin/sh", cygheap->user.name (), @@ -102,7 +103,7 @@ internal_getpwsid (cygsid &sid) char *ptr1, *ptr2, *endptr; char sid_string[128] = {0,','}; - pr.refresh (); + pr.refresh (false); if (sid.string (sid_string + 2)) { @@ -252,8 +253,8 @@ getpwnam_r (const char *nam, struct passwd *pwd, char *buffer, size_t bufsize, s extern "C" struct passwd * getpwent (void) { - pr.refresh (); - + if (pw_pos == 0) + pr.refresh (true); if (pw_pos < pr.curr_lines) return passwd_buf + pw_pos++; @@ -290,8 +291,6 @@ getpass (const char * prompt) char *pass=_reent_winsup ()->_pass; struct termios ti, newti; - pr.refresh (); - cygheap_fdget fhstdin (0); if (fhstdin < 0) |