Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nss/hosts.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2008-01-03 11:34:39 +0100
committerArthur de Jong <arthur@arthurdejong.org>2008-01-03 11:34:39 +0100
commit04d2ae9fed5f3229fea740aaa13f1fe65e90b25a (patch)
treea8dd7bcbbf67eaff872b55dd87ffcbb85b72a4fb /nss/hosts.c
parent95dfcb1b388e49ea65b4dbbadcedf528387cc364 (diff)
only start the NSLCD_ACTION_*_ALL requests with the first call to getent() instead of with setent() to avoid unneeded requests if compat is used (except with netgroups)
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@556 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nss/hosts.c')
-rw-r--r--nss/hosts.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/nss/hosts.c b/nss/hosts.c
index 6fab24e..fc8c508 100644
--- a/nss/hosts.c
+++ b/nss/hosts.c
@@ -2,7 +2,7 @@
hosts.c - NSS lookup functions for hosts database
Copyright (C) 2006 West Consulting
- Copyright (C) 2006, 2007 Arthur de Jong
+ Copyright (C) 2006, 2007, 2008 Arthur de Jong
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -223,11 +223,7 @@ static __thread TFILE *hostentfp;
enum nss_status _nss_ldap_sethostent(int UNUSED(stayopen))
{
- /* temporary storage for h_errno
- (used in NSS_SETENT error handling) */
- int h_errnotmp;
- int *h_errnop=&h_errnotmp;
- NSS_SETENT(hostentfp,NSLCD_ACTION_HOST_ALL);
+ NSS_SETENT(hostentfp);
}
/* this function only returns addresses of the AF_INET address family */
@@ -235,7 +231,7 @@ enum nss_status _nss_ldap_gethostent_r(
struct hostent *result,
char *buffer,size_t buflen,int *errnop,int *h_errnop)
{
- NSS_GETENT(hostentfp,
+ NSS_GETENT(hostentfp,NSLCD_ACTION_HOST_ALL,
read_hostent_nextonempty(hostentfp,AF_INET,result,buffer,buflen,errnop,h_errnop));
}