From: Todd C. Miller Date: Tue, 16 Nov 2004 23:55:26 +0000 (+0000) Subject: Use supplementary group vector in struct sudo_user. X-Git-Tag: SUDO_1_7_0~814 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc85c6f02deb204c8fca93bcf1f5ddd075c96931;p=sudo Use supplementary group vector in struct sudo_user. --- diff --git a/ldap.c b/ldap.c index 2f30209bd..b07cc5ed6 100644 --- a/ldap.c +++ b/ldap.c @@ -424,8 +424,6 @@ char * sudo_ldap_build_pass1() { struct group *grp; - gid_t *grplist=NULL; - int ngrps; int i; char *b=NULL; @@ -447,20 +445,15 @@ sudo_ldap_build_pass1() ncat(&b,&sz,")"); } - /* handle arbitrary number of groups */ - if (0<(ngrps=getgroups(0,NULL))){ - grplist=calloc(ngrps,sizeof(gid_t)); - if (grplist!=NULL && (0gr_name); - ncat(&b,&sz,")"); - } - } + /* Append supplementary groups */ + for(i=0;igr_name); + ncat(&b,&sz,")"); + } } - /* Add ALL to list */ ncat(&b,&sz,"(sudoUser=ALL)");