aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Korn <dave.korn.cygwin@gmail.com>2007-08-31 00:39:41 +0000
committerDave Korn <dave.korn.cygwin@gmail.com>2007-08-31 00:39:41 +0000
commitd848b3419f466800f9e266d96033dc2773a19908 (patch)
tree3dc996d792707c8806ebc8c2093d545751863485
parentb440439a899768a7fce0f1c414f86f9fc1473553 (diff)
downloadnewlib-d848b3419f466800f9e266d96033dc2773a19908.zip
newlib-d848b3419f466800f9e266d96033dc2773a19908.tar.gz
newlib-d848b3419f466800f9e266d96033dc2773a19908.tar.bz2
2007-08-31 Dave Korn <dave.korn@artimi.com>
* mkgroup.c (enum_groups): Use MAX_PREFERRED_LENGTH in netgroupenum call so that it will automatically size returned buffer sufficiently.
-rw-r--r--winsup/utils/ChangeLog5
-rw-r--r--winsup/utils/mkgroup.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index 66936fd..47656e9 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,3 +1,8 @@
+2007-08-31 Dave Korn <dave.korn@artimi.com>
+
+ * mkgroup.c (enum_groups): Use MAX_PREFERRED_LENGTH in netgroupenum
+ call so that it will automatically size returned buffer sufficiently.
+
2007-08-03 Dave Korn <dave.korn@artimi.com>
* Makefile.in (cygcheck.exe): Add bloda.o as prerequisite, adjusting
diff --git a/winsup/utils/mkgroup.c b/winsup/utils/mkgroup.c
index 3761629..1926d91 100644
--- a/winsup/utils/mkgroup.c
+++ b/winsup/utils/mkgroup.c
@@ -350,7 +350,7 @@ enum_groups (LPWSTR servername, int print_sids, int print_users, int id_offset,
entriesread=1;
}
else
- rc = netgroupenum (servername, 2, (void *) & buffer, 1024,
+ rc = netgroupenum (servername, 2, (void *) & buffer, MAX_PREFERRED_LENGTH,
&entriesread, &totalentries, &resume_handle);
switch (rc)
{