LDAP *ld;
struct ldap_result *result;
char *username;
+ GETGROUPS_T *groups;
};
struct sudo_nss sudo_nss_ldap = {
"NOSETENV: " : "SETENV: ";
if (tag != NULL)
lbuf_append(lbuf, tag, NULL);
- /* XXX - ignores other options */
}
ldap_value_free_len(bv);
}
handle->ld = ld;
handle->result = NULL;
handle->username = NULL;
+ handle->groups = NULL;
nss->handle = handle;
return(0);
efree(handle->username);
handle->username = NULL;
}
+ handle->groups = NULL;
handle->result = NULL;
}
}
* have to contact the LDAP server again.
*/
if (handle->result) {
- if (strcmp(pw->pw_name, handle->username) == 0) {
+ if (handle->groups == user_groups &&
+ strcmp(pw->pw_name, handle->username) == 0) {
DPRINTF(("reusing previous result (user %s) with %d entries",
handle->username, handle->result->nentries), 1);
return(handle->result);
/* Store everything in the sudo_nss handle. */
handle->result = lres;
handle->username = estrdup(pw->pw_name);
+ handle->groups = user_groups;
return(lres);
}