summaryrefslogtreecommitdiffstats
path: root/sys/rpc
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2010-01-12 07:49:34 +0000
committerbrooks <brooks@FreeBSD.org>2010-01-12 07:49:34 +0000
commita093b41dafbd7defb7612a20d5672d938b8a54ed (patch)
treede91cf4c019f8024f0f1e02debf82cece77d60f2 /sys/rpc
parent5d104fe3d7b80ec6fa42b6b91bdfb5c7b24c7775 (diff)
downloadFreeBSD-src-a093b41dafbd7defb7612a20d5672d938b8a54ed.zip
FreeBSD-src-a093b41dafbd7defb7612a20d5672d938b8a54ed.tar.gz
Replace the static NGROUPS=NGROUPS_MAX+1=1024 with a dynamic
kern.ngroups+1. kern.ngroups can range from NGROUPS_MAX=1023 to INT_MAX-1. Given that the Windows group limit is 1024, this range should be sufficient for most applications. MFC after: 1 month
Diffstat (limited to 'sys/rpc')
-rw-r--r--sys/rpc/authunix_prot.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/rpc/authunix_prot.c b/sys/rpc/authunix_prot.c
index fc03dff..b1b70a5 100644
--- a/sys/rpc/authunix_prot.c
+++ b/sys/rpc/authunix_prot.c
@@ -110,7 +110,7 @@ xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred)
if (!xdr_uint32_t(xdrs, &ngroups))
return (FALSE);
for (i = 0; i < ngroups; i++) {
- if (i + 1 < NGROUPS) {
+ if (i + 1 < ngroups_max + 1) {
if (!xdr_uint32_t(xdrs, &cred->cr_groups[i + 1]))
return (FALSE);
} else {
@@ -120,8 +120,8 @@ xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred)
}
if (xdrs->x_op == XDR_DECODE) {
- if (ngroups + 1 > NGROUPS)
- cred->cr_ngroups = NGROUPS;
+ if (ngroups + 1 > ngroups_max + 1)
+ cred->cr_ngroups = ngroups_max + 1;
else
cred->cr_ngroups = ngroups + 1;
}
OpenPOWER on IntegriCloud