Implement group caching and use the passwd and group caches throughout.

This commit is contained in:
Todd C. Miller
2004-11-16 04:24:11 +00:00
parent fd46c2c3ef
commit 9846e562ad
11 changed files with 286 additions and 45 deletions

4
ldap.c
View File

@@ -440,7 +440,7 @@ sudo_ldap_build_pass1()
ncat(&b,&sz,")");
/* Append primary group */
grp=getgrgid(getgid());
grp=sudo_getgrgid(getgid());
if (grp!=NULL){
ncat(&b,&sz,"(sudoUser=%");
ncat(&b,&sz,grp->gr_name);
@@ -452,7 +452,7 @@ sudo_ldap_build_pass1()
grplist=calloc(ngrps,sizeof(gid_t));
if (grplist!=NULL && (0<getgroups(ngrps,grplist)))
for(i=0;i<ngrps;i++){
if((grp=getgrgid(grplist[i]))!=NULL){
if((grp=sudo_getgrgid(grplist[i]))!=NULL){
ncat(&b,&sz,"(sudoUser=%");
ncat(&b,&sz,grp->gr_name);
ncat(&b,&sz,")");