summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_uid16.c
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/compat/linux/linux_uid16.c
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/compat/linux/linux_uid16.c')
-rw-r--r--sys/compat/linux/linux_uid16.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_uid16.c b/sys/compat/linux/linux_uid16.c
index b49bf78..7bbfc8d 100644
--- a/sys/compat/linux/linux_uid16.c
+++ b/sys/compat/linux/linux_uid16.c
@@ -109,7 +109,7 @@ linux_setgroups16(struct thread *td, struct linux_setgroups16_args *args)
#endif
ngrp = args->gidsetsize;
- if (ngrp < 0 || ngrp >= NGROUPS)
+ if (ngrp < 0 || ngrp > ngroups_max)
return (EINVAL);
linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK);
error = copyin(args->gidset, linux_gidset, ngrp * sizeof(l_gid16_t));
OpenPOWER on IntegriCloud