summaryrefslogtreecommitdiff
path: root/nss/aliases.c
diff options
context:
space:
mode:
Diffstat (limited to 'nss/aliases.c')
-rw-r--r--nss/aliases.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/nss/aliases.c b/nss/aliases.c
index 042132a..bbbb1ee 100644
--- a/nss/aliases.c
+++ b/nss/aliases.c
@@ -2,7 +2,7 @@
aliases.c - NSS lookup functions for aliases database
Copyright (C) 2006 West Consulting
- Copyright (C) 2006, 2007, 2008 Arthur de Jong
+ Copyright (C) 2006, 2007, 2008, 2010 Arthur de Jong
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -28,6 +28,7 @@
#include "prototypes.h"
#include "common.h"
+/* read an alias entry from the stream */
static nss_status_t read_aliasent(
TFILE *fp,struct aliasent *result,
char *buffer,size_t buflen,int *errnop)
@@ -46,6 +47,7 @@ static nss_status_t read_aliasent(
return NSS_STATUS_SUCCESS;
}
+/* get an alias entry by name */
nss_status_t _nss_ldap_getaliasbyname_r(
const char *name,struct aliasent *result,
char *buffer,size_t buflen,int *errnop)
@@ -58,17 +60,22 @@ nss_status_t _nss_ldap_getaliasbyname_r(
/* thread-local file pointer to an ongoing request */
static __thread TFILE *aliasentfp;
+/* start a request to read all aliases */
nss_status_t _nss_ldap_setaliasent(void)
{
NSS_SETENT(aliasentfp);
}
-nss_status_t _nss_ldap_getaliasent_r(struct aliasent *result,char *buffer,size_t buflen,int *errnop)
+/* read a single alias entry from the stream */
+nss_status_t _nss_ldap_getaliasent_r(
+ struct aliasent *result,
+ char *buffer,size_t buflen,int *errnop)
{
NSS_GETENT(aliasentfp,NSLCD_ACTION_ALIAS_ALL,
read_aliasent(aliasentfp,result,buffer,buflen,errnop));
}
+/* close the stream opened with setaliasent() above */
nss_status_t _nss_ldap_endaliasent(void)
{
NSS_ENDENT(aliasentfp);