diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2010-10-04 20:27:57 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2010-10-04 20:27:57 +0000 |
commit | d5c07d9403bc42f08de10331979a73f2db399b59 (patch) | |
tree | d4be106bf36e52c0ff2ee11132f5accbc5cb2180 /nss/networks.c | |
parent | 6a2c600499039036b1fa0efcd45747b21308375c (diff) | |
parent | 24fae4c5df0c5152891893ab677edb4a9b497d11 (diff) |
merge changes from trunk
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1242 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nss/networks.c')
-rw-r--r-- | nss/networks.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/nss/networks.c b/nss/networks.c index 13b9e7c..923f562 100644 --- a/nss/networks.c +++ b/nss/networks.c @@ -33,7 +33,7 @@ #include "common.h" #include "compat/attrs.h" -/* Redifine some ERROR_OUT macros as we also want to set h_errnop. */ +/* Redefine some ERROR_OUT macros as we also want to set h_errnop. */ #undef ERROR_OUT_OPENERROR #define ERROR_OUT_OPENERROR \ @@ -113,9 +113,10 @@ static nss_status_t read_netent( #ifdef NSS_FLAVOUR_GLIBC +/* get a network entry by name */ nss_status_t _nss_ldap_getnetbyname_r( - const char *name,struct netent *result,char *buffer, - size_t buflen,int *errnop,int *h_errnop) + const char *name,struct netent *result, + char *buffer,size_t buflen,int *errnop,int *h_errnop) { NSS_BYNAME(NSLCD_ACTION_NETWORK_BYNAME,buffer,buflen, name, @@ -138,20 +139,23 @@ nss_status_t _nss_ldap_getnetbyaddr_r( /* thread-local file pointer to an ongoing request */ static __thread TFILE *netentfp; +/* start a request to read all networks */ nss_status_t _nss_ldap_setnetent(int UNUSED(stayopen)) { NSS_SETENT(netentfp); } +/* get a single network entry from the stream */ nss_status_t _nss_ldap_getnetent_r( - struct netent *result,char *buffer,size_t buflen, - int *errnop,int *h_errnop) + struct netent *result, + char *buffer,size_t buflen,int *errnop,int *h_errnop) { NSS_GETENT(netentfp,NSLCD_ACTION_NETWORK_ALL,buffer,buflen, read_netent(netentfp,result,buffer,buflen,errnop,h_errnop)); return retv; } +/* close the stream opened by setnetent() above */ nss_status_t _nss_ldap_endnetent(void) { NSS_ENDENT(netentfp); |