From 02a6422cf02e5f69f1943bafaa8d9bbebfd8dd68 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Thu, 21 Oct 2010 15:04:48 +0000 Subject: [PATCH] expoand group list # to 65k - in case, and handle < 0 return. SVN revision: 53716 --- src/bin/e_sys_main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/bin/e_sys_main.c b/src/bin/e_sys_main.c index b7f97089e..411935f83 100644 --- a/src/bin/e_sys_main.c +++ b/src/bin/e_sys_main.c @@ -30,7 +30,7 @@ main(int argc, char **argv) int test = 0; char *action, *cmd; uid_t uid; - gid_t gid, gl[1024], egid; + gid_t gid, gl[65536], egid; for (i = 1; i < argc; i++) { @@ -62,8 +62,12 @@ main(int argc, char **argv) uid = getuid(); gid = getgid(); egid = getegid(); - gn = getgroups(1024, gl); - + gn = getgroups(65536, gl); + if (gn < 0) + { + printf("ERROR: MEMBER OF MORE THAN 65536 GROUPS\n"); + exit(3); + } if (setuid(0) != 0) { printf("ERROR: UNABLE TO ASSUME ROOT PRIVILEDGES\n");