All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [BK PATCH 3/4] fix NGROUPS hard limit (resend)
@ 2002-10-22  0:36 Timothy Hockin
  0 siblings, 0 replies; 2+ messages in thread
From: Timothy Hockin @ 2002-10-22  0:36 UTC (permalink / raw
  To: torvalds, linux-kernel

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.810   -> 1.811  
#	include/linux/sunrpc/svcauth.h	1.4     -> 1.5    
#	net/sunrpc/svcauth_unix.c	1.7     -> 1.8    
#	      fs/nfsd/auth.c	1.1     -> 1.2    
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/10/21	thockin@freakshow.cobalt.com	1.811
# fix usage of NGROUPS in nfsd and svcauth
# --------------------------------------------
#
diff -Nru a/fs/nfsd/auth.c b/fs/nfsd/auth.c
--- a/fs/nfsd/auth.c	Mon Oct 21 17:14:34 2002
+++ b/fs/nfsd/auth.c	Mon Oct 21 17:14:34 2002
@@ -10,12 +10,15 @@
 #include <linux/sunrpc/svcauth.h>
 #include <linux/nfsd/nfsd.h>
 
+extern asmlinkage long sys_setgroups(int gidsetsize, gid_t *grouplist);
+
 #define	CAP_NFSD_MASK (CAP_FS_MASK|CAP_TO_MASK(CAP_SYS_RESOURCE))
 void
 nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
 {
 	struct svc_cred	*cred = &rqstp->rq_cred;
 	int		i;
+	gid_t		groups[SVC_CRED_NGROUPS];
 
 	if (rqstp->rq_userset)
 		return;
@@ -29,7 +32,7 @@
 			cred->cr_uid = exp->ex_anon_uid;
 		if (!cred->cr_gid)
 			cred->cr_gid = exp->ex_anon_gid;
-		for (i = 0; i < NGROUPS; i++)
+		for (i = 0; i < SVC_CRED_NGROUPS; i++)
 			if (!cred->cr_groups[i])
 				cred->cr_groups[i] = exp->ex_anon_gid;
 	}
@@ -42,13 +45,13 @@
 		current->fsgid = cred->cr_gid;
 	else
 		current->fsgid = exp->ex_anon_gid;
-	for (i = 0; i < NGROUPS; i++) {
+	for (i = 0; i < SVC_CRED_NGROUPS; i++) {
 		gid_t group = cred->cr_groups[i];
 		if (group == (gid_t) NOGROUP)
 			break;
-		current->groups[i] = group;
+		groups[i] = group;
 	}
-	current->ngroups = i;
+	sys_setgroups(i, groups);
 
 	if ((cred->cr_uid)) {
 		cap_t(current->cap_effective) &= ~CAP_NFSD_MASK;
diff -Nru a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h
--- a/include/linux/sunrpc/svcauth.h	Mon Oct 21 17:14:34 2002
+++ b/include/linux/sunrpc/svcauth.h	Mon Oct 21 17:14:34 2002
@@ -14,10 +14,11 @@
 #include <linux/sunrpc/msg_prot.h>
 #include <linux/sunrpc/cache.h>
 
+#define SVC_CRED_NGROUPS	32
 struct svc_cred {
 	uid_t			cr_uid;
 	gid_t			cr_gid;
-	gid_t			cr_groups[NGROUPS];
+	gid_t			cr_groups[SVC_CRED_NGROUPS];
 };
 
 struct svc_rqst;		/* forward decl */
diff -Nru a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
--- a/net/sunrpc/svcauth_unix.c	Mon Oct 21 17:14:34 2002
+++ b/net/sunrpc/svcauth_unix.c	Mon Oct 21 17:14:34 2002
@@ -392,9 +392,9 @@
 	slen = ntohl(*bufp++);			/* gids length */
 	if (slen > 16 || (len -= slen + 2) < 0)
 		goto badcred;
-	for (i = 0; i < NGROUPS && i < slen; i++)
+	for (i = 0; i < SVC_CRED_NGROUPS && i < slen; i++)
 		cred->cr_groups[i] = ntohl(*bufp++);
-	if (i < NGROUPS)
+	if (i < SVC_CRED_NGROUPS)
 		cred->cr_groups[i] = NOGROUP;
 	bufp += (slen - i);
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [BK PATCH 3/4] fix NGROUPS hard limit (resend)
@ 2002-10-29 19:32 Timothy Hockin
  0 siblings, 0 replies; 2+ messages in thread
From: Timothy Hockin @ 2002-10-29 19:32 UTC (permalink / raw
  To: torvalds, linux-kernel

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.810   -> 1.811  
#	include/linux/sunrpc/svcauth.h	1.4     -> 1.5    
#	net/sunrpc/svcauth_unix.c	1.7     -> 1.8    
#	      fs/nfsd/auth.c	1.1     -> 1.2    
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/10/21	thockin@freakshow.cobalt.com	1.811
# fix usage of NGROUPS in nfsd and svcauth
# --------------------------------------------
#
diff -Nru a/fs/nfsd/auth.c b/fs/nfsd/auth.c
--- a/fs/nfsd/auth.c	Mon Oct 21 17:14:34 2002
+++ b/fs/nfsd/auth.c	Mon Oct 21 17:14:34 2002
@@ -10,12 +10,15 @@
 #include <linux/sunrpc/svcauth.h>
 #include <linux/nfsd/nfsd.h>
 
+extern asmlinkage long sys_setgroups(int gidsetsize, gid_t *grouplist);
+
 #define	CAP_NFSD_MASK (CAP_FS_MASK|CAP_TO_MASK(CAP_SYS_RESOURCE))
 void
 nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
 {
 	struct svc_cred	*cred = &rqstp->rq_cred;
 	int		i;
+	gid_t		groups[SVC_CRED_NGROUPS];
 
 	if (rqstp->rq_userset)
 		return;
@@ -29,7 +32,7 @@
 			cred->cr_uid = exp->ex_anon_uid;
 		if (!cred->cr_gid)
 			cred->cr_gid = exp->ex_anon_gid;
-		for (i = 0; i < NGROUPS; i++)
+		for (i = 0; i < SVC_CRED_NGROUPS; i++)
 			if (!cred->cr_groups[i])
 				cred->cr_groups[i] = exp->ex_anon_gid;
 	}
@@ -42,13 +45,13 @@
 		current->fsgid = cred->cr_gid;
 	else
 		current->fsgid = exp->ex_anon_gid;
-	for (i = 0; i < NGROUPS; i++) {
+	for (i = 0; i < SVC_CRED_NGROUPS; i++) {
 		gid_t group = cred->cr_groups[i];
 		if (group == (gid_t) NOGROUP)
 			break;
-		current->groups[i] = group;
+		groups[i] = group;
 	}
-	current->ngroups = i;
+	sys_setgroups(i, groups);
 
 	if ((cred->cr_uid)) {
 		cap_t(current->cap_effective) &= ~CAP_NFSD_MASK;
diff -Nru a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h
--- a/include/linux/sunrpc/svcauth.h	Mon Oct 21 17:14:34 2002
+++ b/include/linux/sunrpc/svcauth.h	Mon Oct 21 17:14:34 2002
@@ -14,10 +14,11 @@
 #include <linux/sunrpc/msg_prot.h>
 #include <linux/sunrpc/cache.h>
 
+#define SVC_CRED_NGROUPS	32
 struct svc_cred {
 	uid_t			cr_uid;
 	gid_t			cr_gid;
-	gid_t			cr_groups[NGROUPS];
+	gid_t			cr_groups[SVC_CRED_NGROUPS];
 };
 
 struct svc_rqst;		/* forward decl */
diff -Nru a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
--- a/net/sunrpc/svcauth_unix.c	Mon Oct 21 17:14:34 2002
+++ b/net/sunrpc/svcauth_unix.c	Mon Oct 21 17:14:34 2002
@@ -392,9 +392,9 @@
 	slen = ntohl(*bufp++);			/* gids length */
 	if (slen > 16 || (len -= slen + 2) < 0)
 		goto badcred;
-	for (i = 0; i < NGROUPS && i < slen; i++)
+	for (i = 0; i < SVC_CRED_NGROUPS && i < slen; i++)
 		cred->cr_groups[i] = ntohl(*bufp++);
-	if (i < NGROUPS)
+	if (i < SVC_CRED_NGROUPS)
 		cred->cr_groups[i] = NOGROUP;
 	bufp += (slen - i);
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-10-29 19:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-22  0:36 [BK PATCH 3/4] fix NGROUPS hard limit (resend) Timothy Hockin
  -- strict thread matches above, loose matches on Subject: below --
2002-10-29 19:32 Timothy Hockin

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.