diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 988572bb1..2e5e4e9fa 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2003-01-01 Christopher Faylor + + * sysconf.cc (sysconf): Return arbitrary values for + _SC_GETGR_R_SIZE_MAX, _SC_LOGIN_NAME_MAX, _SC_GETPW_R_SIZE_MAX. + + * passwd.cc (getpwuid_r32): Add uid/gid fields to size check + calculation. + 2002-12-30 Christopher Faylor * exceptions.cc (events_init): Display name of mutex on failure. diff --git a/winsup/cygwin/passwd.cc b/winsup/cygwin/passwd.cc index c3bb7a115..8f947a4fc 100644 --- a/winsup/cygwin/passwd.cc +++ b/winsup/cygwin/passwd.cc @@ -266,7 +266,8 @@ getpwuid_r32 (__uid32_t uid, struct passwd *pwd, char *buffer, size_t bufsize, s /* check needed buffer size. */ size_t needsize = strlen (temppw->pw_name) + strlen (temppw->pw_dir) + strlen (temppw->pw_shell) + strlen (temppw->pw_gecos) + - strlen (temppw->pw_passwd) + 5; + strlen (temppw->pw_passwd) + 5 + + sizeof (temppw->pw_uid) + sizeof (temppw->pw_gid); if (needsize > bufsize) return ERANGE; diff --git a/winsup/cygwin/sysconf.cc b/winsup/cygwin/sysconf.cc index 0232faf39..f0f49778d 100644 --- a/winsup/cygwin/sysconf.cc +++ b/winsup/cygwin/sysconf.cc @@ -47,6 +47,10 @@ sysconf (int in) return NGROUPS_MAX; case _SC_SAVED_IDS: return _POSIX_SAVED_IDS; + case _SC_LOGIN_NAME_MAX: + case _SC_GETPW_R_SIZE_MAX: + case _SC_GETGR_R_SIZE_MAX: + return 16*1024; case _SC_VERSION: return _POSIX_VERSION; #if 0 /* FIXME -- unimplemented */