diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2010-10-08 13:56:56 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2010-10-08 13:56:56 +0200 |
commit | 611dc583a05914f81c97c165163bcce021b0dfac (patch) | |
tree | 7136faabebdef16fc8690f1fee37d209a53fa7dd /nss/services.c | |
parent | 5afa471c1b514d82da2fde66fbed699a2e2862fa (diff) |
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
Diffstat (limited to 'nss/services.c')
-rw-r--r-- | nss/services.c | 21 |
1 files changed, 12 insertions, 9 deletions
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) |