Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nslcd/host.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2007-09-07 13:10:45 +0200
committerArthur de Jong <arthur@arthurdejong.org>2007-09-07 13:10:45 +0200
commit7ded202fd6128c9e4586a63df1bf8a36c8835f11 (patch)
tree4f5160caeb214648aa4cb5b23691dce0127762d9 /nslcd/host.c
parent916f4afca2d7a655e7179f350d09362a18661bb5 (diff)
also pass search filter for the *_all() functions from the database module instead of doing it in ldap-nss.c
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@377 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/host.c')
-rw-r--r--nslcd/host.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/nslcd/host.c b/nslcd/host.c
index dc74f02..9d1cc15 100644
--- a/nslcd/host.c
+++ b/nslcd/host.c
@@ -388,7 +388,8 @@ int nslcd_host_byaddr(TFILE *fp)
int nslcd_host_all(TFILE *fp)
{
int32_t tmpint32;
- static struct ent_context *host_context;
+ struct ent_context *host_context;
+ char filter[1024];
/* these are here for now until we rewrite the LDAP code */
struct hostent result;
char buffer[1024];
@@ -403,15 +404,16 @@ int nslcd_host_all(TFILE *fp)
if (_nss_ldap_ent_context_init(&host_context)==NULL)
return -1;
/* loop over all results */
+ mkfilter_host_all(filter,sizeof(filter));
host_attrs_init();
- while ((retv=nss2nslcd(_nss_ldap_getent(&host_context,&result,buffer,1024,&errnop,_nss_ldap_filt_gethostent,LM_HOSTS,
- host_attrs,
+ while ((retv=_nss_ldap_getent(&host_context,&result,buffer,sizeof(buffer),&errnop,
+ NULL,filter,host_attrs,LM_HOSTS,
#ifdef INET6
(_res.options&RES_USE_INET6)?_nss_ldap_parse_hostv6:_nss_ldap_parse_hostv4
#else
_nss_ldap_parse_hostv4
#endif
- )))==NSLCD_RESULT_SUCCESS)
+ ))==NSLCD_RESULT_SUCCESS)
{
/* write the result */
WRITE_INT32(fp,retv);