All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Finney <Sean.Finney@sonyericsson.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH] Use a named constant for max number of managed groups, and increase it.
Date: Tue, 29 Mar 2011 09:48:36 +0200	[thread overview]
Message-ID: <E1Q5EOD-0001a7-IQ@seldlx2151.corpusers.net> (raw)

---
 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


                 reply	other threads:[~2011-03-31  9:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1Q5EOD-0001a7-IQ@seldlx2151.corpusers.net \
    --to=sean.finney@sonyericsson.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.