summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpc.lockd
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2005-11-17 12:19:19 +0000
committerharti <harti@FreeBSD.org>2005-11-17 12:19:19 +0000
commit1e3942d92fbfc6325be930d198f024249f617bcb (patch)
tree09ef840c8ff36f332f376ede7f3140f7472b78ad /usr.sbin/rpc.lockd
parent03dcfc1488f97956f1bdfbabfe376109a259278f (diff)
downloadFreeBSD-src-1e3942d92fbfc6325be930d198f024249f617bcb.zip
FreeBSD-src-1e3942d92fbfc6325be930d198f024249f617bcb.tar.gz
When a user is in more than 16 groups the call to authunix_create() will
result in abort() beeing called. This is because there is a limit of the number of groups in the RPC which is 16. When the actual number of groups is too large it results in xdr_array() returning an error which, in turn, authunix_create() handles by just calling abort(). Fix this by passing only the first 16 groups to authunix_create().
Diffstat (limited to 'usr.sbin/rpc.lockd')
-rw-r--r--usr.sbin/rpc.lockd/kern.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/rpc.lockd/kern.c b/usr.sbin/rpc.lockd/kern.c
index ef5d268..c7473f6 100644
--- a/usr.sbin/rpc.lockd/kern.c
+++ b/usr.sbin/rpc.lockd/kern.c
@@ -231,12 +231,17 @@ set_auth(cl, xucred)
CLIENT *cl;
struct xucred *xucred;
{
+ int ngroups;
+
+ ngroups = xucred->cr_ngroups - 1;
+ if (ngroups > NGRPS)
+ ngroups = NGRPS;
if (cl->cl_auth != NULL)
cl->cl_auth->ah_ops->ah_destroy(cl->cl_auth);
cl->cl_auth = authunix_create(hostname,
xucred->cr_uid,
xucred->cr_groups[0],
- xucred->cr_ngroups - 1,
+ ngroups,
&xucred->cr_groups[1]);
}
OpenPOWER on IntegriCloud