diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2007-09-07 20:51:46 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2007-09-07 20:51:46 +0000 |
commit | 30423d96ecd243663906a3a1c13f1f0e90ac6330 (patch) | |
tree | ed94021c35b761bc355e7bec8cf4ce4379fe9c86 /nslcd/ether.c | |
parent | 6592036689c38566acbafc178e1f22098279263f (diff) |
make handling of ent_context consistent and simpler
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@382 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/ether.c')
-rw-r--r-- | nslcd/ether.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/nslcd/ether.c b/nslcd/ether.c index ac66519..39c7b9f 100644 --- a/nslcd/ether.c +++ b/nslcd/ether.c @@ -225,7 +225,7 @@ int nslcd_ether_all(TFILE *fp) { int32_t tmpint32; char filter[1024]; - struct ent_context *ether_context=NULL; + struct ent_context context; /* these are here for now until we rewrite the LDAP code */ struct ether result; char buffer[1024]; @@ -237,12 +237,11 @@ int nslcd_ether_all(TFILE *fp) WRITE_INT32(fp,NSLCD_VERSION); WRITE_INT32(fp,NSLCD_ACTION_ETHER_ALL); /* initialize context */ - if (_nss_ldap_ent_context_init(ðer_context)==NULL) - return -1; + _nss_ldap_ent_context_init(&context); /* loop over all results */ mkfilter_ether_all(filter,sizeof(filter)); ether_attrs_init(); - while ((retv=_nss_ldap_getent(ðer_context,&result,buffer,sizeof(buffer),&errnop, + while ((retv=_nss_ldap_getent(&context,&result,buffer,sizeof(buffer),&errnop, NULL,filter,ether_attrs,LM_ETHERS,_nss_ldap_parse_ether))==NSLCD_RESULT_SUCCESS) { /* write the result */ @@ -254,7 +253,7 @@ int nslcd_ether_all(TFILE *fp) WRITE_FLUSH(fp); /* FIXME: if a previous call returns what happens to the context? */ _nss_ldap_enter(); - _nss_ldap_ent_context_release(ether_context); + _nss_ldap_ent_context_cleanup(&context); _nss_ldap_leave(); /* we're done */ return 0; |