summaryrefslogtreecommitdiff
path: root/nss/rpc.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2010-10-04 20:27:57 +0000
committerArthur de Jong <arthur@arthurdejong.org>2010-10-04 20:27:57 +0000
commitd5c07d9403bc42f08de10331979a73f2db399b59 (patch)
treed4be106bf36e52c0ff2ee11132f5accbc5cb2180 /nss/rpc.c
parent6a2c600499039036b1fa0efcd45747b21308375c (diff)
parent24fae4c5df0c5152891893ab677edb4a9b497d11 (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/rpc.c')
-rw-r--r--nss/rpc.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/nss/rpc.c b/nss/rpc.c
index 374ec12..6a33758 100644
--- a/nss/rpc.c
+++ b/nss/rpc.c
@@ -30,6 +30,7 @@
#include "common.h"
#include "compat/attrs.h"
+/* read a sinlge rpc entry from the stream */
static nss_status_t read_rpcent(
TFILE *fp,struct rpcent *result,
char *buffer,size_t buflen,int *errnop)
@@ -44,9 +45,10 @@ static nss_status_t read_rpcent(
#ifdef NSS_FLAVOUR_GLIBC
+/* get a rpc entry by name */
nss_status_t _nss_ldap_getrpcbyname_r(
- const char *name,struct rpcent *result,char *buffer,
- size_t buflen,int *errnop)
+ const char *name,struct rpcent *result,
+ char *buffer,size_t buflen,int *errnop)
{
NSS_BYNAME(NSLCD_ACTION_RPC_BYNAME,buffer,buflen,
name,
@@ -54,9 +56,10 @@ nss_status_t _nss_ldap_getrpcbyname_r(
return retv;
}
+/* get a rpc entry by number */
nss_status_t _nss_ldap_getrpcbynumber_r(
- int number,struct rpcent *result,char *buffer,
- size_t buflen,int *errnop)
+ int number,struct rpcent *result,
+ char *buffer,size_t buflen,int *errnop)
{
NSS_BYINT32(NSLCD_ACTION_RPC_BYNUMBER,buffer,buflen,
number,
@@ -67,19 +70,23 @@ nss_status_t _nss_ldap_getrpcbynumber_r(
/* thread-local file pointer to an ongoing request */
static __thread TFILE *protoentfp;
+/* request a stream to list all rpc entries */
nss_status_t _nss_ldap_setrpcent(int UNUSED(stayopen))
{
NSS_SETENT(protoentfp);
}
+/* get an rpc entry from the list */
nss_status_t _nss_ldap_getrpcent_r(
- struct rpcent *result,char *buffer,size_t buflen,int *errnop)
+ struct rpcent *result,
+ char *buffer,size_t buflen,int *errnop)
{
NSS_GETENT(protoentfp,NSLCD_ACTION_RPC_ALL,buffer,buflen,
read_rpcent(protoentfp,result,buffer,buflen,errnop));
return retv;
}
+/* close the stream opened by setrpcent() above */
nss_status_t _nss_ldap_endrpcent(void)
{
NSS_ENDENT(protoentfp);