From 9c37b7e296742993a6038000decb0264d23b6341 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Thu, 14 Oct 2010 19:00:51 +0000 Subject: move _nss_ldap_initgroups_dyn() definition to the end to have more logical order git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1272 ef36b2f9-881f-0410-afb5-c4e39611909c --- nss/group.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'nss') diff --git a/nss/group.c b/nss/group.c index 68d9ef8..3f6cc17 100644 --- a/nss/group.c +++ b/nss/group.c @@ -120,6 +120,30 @@ nss_status_t _nss_ldap_getgrgid_r( read_group(fp,result,buffer,buflen,errnop)); } +/* thread-local file pointer to an ongoing request */ +static __thread TFILE *grentfp; + +/* start a request to read all groups */ +nss_status_t _nss_ldap_setgrent(int UNUSED(stayopen)) +{ + NSS_SETENT(grentfp); +} + +/* read a single group from the stream */ +nss_status_t _nss_ldap_getgrent_r( + struct group *result, + char *buffer,size_t buflen,int *errnop) +{ + NSS_GETENT(grentfp,NSLCD_ACTION_GROUP_ALL, + read_group(grentfp,result,buffer,buflen,errnop)); +} + +/* close the stream opened with setgrent() above */ +nss_status_t _nss_ldap_endgrent(void) +{ + NSS_ENDENT(grentfp); +} + /* this function returns a list of groups, documentation for the interface is scarce (any pointers are welcome) but this is what is assumed the parameters mean: @@ -147,27 +171,3 @@ nss_status_t _nss_ldap_initgroups_dyn( #undef buffer #undef buflen } - -/* thread-local file pointer to an ongoing request */ -static __thread TFILE *grentfp; - -/* start a request to read all groups */ -nss_status_t _nss_ldap_setgrent(int UNUSED(stayopen)) -{ - NSS_SETENT(grentfp); -} - -/* read a single group from the stream */ -nss_status_t _nss_ldap_getgrent_r( - struct group *result, - char *buffer,size_t buflen,int *errnop) -{ - NSS_GETENT(grentfp,NSLCD_ACTION_GROUP_ALL, - read_group(grentfp,result,buffer,buflen,errnop)); -} - -/* close the stream opened with setgrent() above */ -nss_status_t _nss_ldap_endgrent(void) -{ - NSS_ENDENT(grentfp); -} -- cgit v1.2.3