From 611dc583a05914f81c97c165163bcce021b0dfac Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Fri, 8 Oct 2010 11:56:56 +0000 Subject: re-introduce {set,get,end}**ent() file handle in Solaris code path and some other miscellaneous small fixes git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1246 ef36b2f9-881f-0410-afb5-c4e39611909c --- nss/services.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'nss/services.c') diff --git a/nss/services.c b/nss/services.c index 61e978a..fb709a4 100644 --- a/nss/services.c +++ b/nss/services.c @@ -72,12 +72,12 @@ nss_status_t _nss_ldap_getservbyport_r( } /* thread-local file pointer to an ongoing request */ -static __thread TFILE *protoentfp; +static __thread TFILE *serventfp; /* open request to get all services */ nss_status_t _nss_ldap_setservent(int UNUSED(stayopen)) { - NSS_SETENT(protoentfp); + NSS_SETENT(serventfp); } /* read a single returned service definition */ @@ -85,15 +85,15 @@ nss_status_t _nss_ldap_getservent_r( struct servent *result, char *buffer,size_t buflen,int *errnop) { - NSS_GETENT(protoentfp,NSLCD_ACTION_SERVICE_ALL,buffer,buflen, - read_servent(protoentfp,result,buffer,buflen,errnop)); + NSS_GETENT(serventfp,NSLCD_ACTION_SERVICE_ALL,buffer,buflen, + read_servent(serventfp,result,buffer,buflen,errnop)); return retv; } /* close the stream opened by setservent() above */ nss_status_t _nss_ldap_endservent(void) { - NSS_ENDENT(protoentfp); + NSS_ENDENT(serventfp); } #endif /* NSS_FLAVOUR_GLIBC */ @@ -120,22 +120,25 @@ static nss_status_t _nss_nslcd_getservbyport_r( return retv; } +/* thread-local file pointer to an ongoing request */ +static __thread TFILE *serventfp; + static nss_status_t _xnss_ldap_setservent(nss_backend_t UNUSED(*be),void UNUSED(*args)) { - NSS_SETENT(protoentfp); + NSS_SETENT(serventfp); } static nss_status_t _nss_nslcd_getservent_r( struct servent *result,char *buffer,size_t buflen,int *errnop) { - NSS_GETENT(protoentfp,NSLCD_ACTION_SERVICE_ALL,buffer,buflen, - read_servent(protoentfp,result,buffer,buflen,errnop)); + NSS_GETENT(serventfp,NSLCD_ACTION_SERVICE_ALL,buffer,buflen, + read_servent(serventfp,result,buffer,buflen,errnop)); return retv; } static nss_status_t _xnss_ldap_endservent(nss_backend_t UNUSED(*be),void UNUSED(*args)) { - NSS_ENDENT(protoentfp); + NSS_ENDENT(serventfp); } static nss_status_t _xnss_ldap_getservbyname_r(nss_backend_t UNUSED(*be),void *args) -- cgit v1.2.3