linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Use a named constant for max number of managed groups, and increase it.
@ 2011-03-29  7:48 Sean Finney
  0 siblings, 0 replies; only message in thread
From: Sean Finney @ 2011-03-29  7:48 UTC (permalink / raw)
  To: linux-nfs

---
 utils/mountd/cache.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
index 9bbbfb3..75a1052 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -37,6 +37,7 @@
 #include "blkid/blkid.h"
 #endif
 
+#define MAX_MANAGED_GROUPS 1000
 
 enum nfsd_fsid {
 	FSID_DEV = 0,
@@ -127,8 +128,8 @@ void auth_unix_gid(FILE *f)
 	 */
 	int uid;
 	struct passwd *pw;
-	gid_t glist[100], *groups = glist;
-	int ngroups = 100;
+	gid_t glist[MAX_MANAGED_GROUPS], *groups = glist;
+	int ngroups = MAX_MANAGED_GROUPS;
 	int rv, i;
 	char *cp;
 
@@ -144,7 +145,7 @@ void auth_unix_gid(FILE *f)
 		rv = -1;
 	else {
 		rv = getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups);
-		if (rv == -1 && ngroups >= 100) {
+		if (rv == -1 && ngroups >= MAX_MANAGED_GROUPS) {
 			groups = malloc(sizeof(gid_t)*ngroups);
 			if (!groups)
 				rv = -1;
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-31  9:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-29  7:48 [PATCH] Use a named constant for max number of managed groups, and increase it Sean Finney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).