diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2007-09-14 18:30:40 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2007-09-14 18:30:40 +0200 |
commit | c5fde824853997d98807b9a51585e4544e86d048 (patch) | |
tree | 2400bccaea77dbc279fc30cd872e0ce6037248b0 /nslcd/netgroup.c | |
parent | b79a013d8b44fbd008019ed8b212a24f66ea2069 (diff) |
get rid of global session and instead pass the session as a parameter with every request and allocate a session per thread
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@391 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/netgroup.c')
-rw-r--r-- | nslcd/netgroup.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/nslcd/netgroup.c b/nslcd/netgroup.c index 7f7c496..dc908d6 100644 --- a/nslcd/netgroup.c +++ b/nslcd/netgroup.c @@ -268,10 +268,9 @@ _nss_ldap_parse_netgr (void *vresultp, char *buffer, size_t buflen) return NSS_STATUS_SUCCESS; } -static enum nss_status -_nss_ldap_load_netgr (LDAPMessage * e, - struct ldap_state * pvt, - void *vresultp, char *buffer, size_t buflen) +static enum nss_status _nss_ldap_load_netgr( + MYLDAP_SESSION *session,LDAPMessage *e,struct ldap_state UNUSED(*state), + void *vresultp,char UNUSED(*buffer),size_t UNUSED(buflen)) { int attr; int nvals; @@ -286,10 +285,10 @@ _nss_ldap_load_netgr (LDAPMessage * e, switch (attr) { case 1: - vals = _nss_ldap_get_values (e, attmap_netgroup_nisNetgroupTriple); + vals=_nss_ldap_get_values(session,e,attmap_netgroup_nisNetgroupTriple); break; default: - vals = _nss_ldap_get_values (e, attmap_netgroup_memberNisNetgroup); + vals=_nss_ldap_get_values(session,e,attmap_netgroup_memberNisNetgroup); break; } @@ -336,7 +335,7 @@ out: return stat; } -int nslcd_netgroup_byname(TFILE *fp) +int nslcd_netgroup_byname(TFILE *fp,MYLDAP_SESSION *session) { int32_t tmpint32; char name[256]; @@ -359,7 +358,7 @@ int nslcd_netgroup_byname(TFILE *fp) /* do initial ldap request */ mkfilter_netgroup_byname(name,filter,sizeof(filter)); netgroup_init(); - if (_nss_ldap_getbyname(&result,buffer,1024,&errnop, + if (_nss_ldap_getbyname(session,&result,buffer,1024,&errnop, netgroup_base,netgroup_scope,filter,netgroup_attrs,_nss_ldap_load_netgr)) return -1; /* loop over all results */ |