aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-01-01 18:12:49 +0000
committerChristopher Faylor <me@cgf.cx>2003-01-01 18:12:49 +0000
commit8619b42be78d0e18192bded34268eb2614a98eba (patch)
tree1f80cb5d87af2c5578fa3f00d4f226991ebadfe4 /winsup/cygwin
parent353549d7441a2a8fddb4467ee796445e9db30abc (diff)
downloadnewlib-8619b42be78d0e18192bded34268eb2614a98eba.zip
newlib-8619b42be78d0e18192bded34268eb2614a98eba.tar.gz
newlib-8619b42be78d0e18192bded34268eb2614a98eba.tar.bz2
* 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.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/passwd.cc3
-rw-r--r--winsup/cygwin/sysconf.cc4
3 files changed, 14 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 988572b..2e5e4e9 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,11 @@
+2003-01-01 Christopher Faylor <cgf@redhat.com>
+
+ * 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 <cgf@redhat.com>
* exceptions.cc (events_init): Display name of mutex on failure.
diff --git a/winsup/cygwin/passwd.cc b/winsup/cygwin/passwd.cc
index c3bb7a1..8f947a4 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 0232faf..f0f4977 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 */