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