Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nslcd/ldap-nss.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2007-09-08 23:37:03 +0200
committerArthur de Jong <arthur@arthurdejong.org>2007-09-08 23:37:03 +0200
commit0e34be5958a08db6dc02c918dce0fa5f25d5fd6b (patch)
treecc200575852fa498457ca83995a9bfa9b0ea979d /nslcd/ldap-nss.c
parentdea750bcb8faff6de2aa72807e58a5fbc468068e (diff)
move nss2nslcd() to ldap-nss.c
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@387 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/ldap-nss.c')
-rw-r--r--nslcd/ldap-nss.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/nslcd/ldap-nss.c b/nslcd/ldap-nss.c
index d954c5b..b3d0593 100644
--- a/nslcd/ldap-nss.c
+++ b/nslcd/ldap-nss.c
@@ -1835,6 +1835,21 @@ do_next_page (const char *base,int scope,const char *filter,const char **attrs,
return (*msgid<0)?NSS_STATUS_UNAVAIL:NSS_STATUS_SUCCESS;
}
+/* translates a nslcd return code (as defined in nslcd.h) to
+ a nss code (as defined in nss.h) */
+/* FIXME: this is a temporary hack, get rid of it */
+static int nss2nslcd(enum nss_status code)
+{
+ switch (code)
+ {
+ case NSS_STATUS_UNAVAIL: return NSLCD_RESULT_UNAVAIL;
+ case NSS_STATUS_NOTFOUND: return NSLCD_RESULT_NOTFOUND;
+ case NSS_STATUS_SUCCESS: return NSLCD_RESULT_SUCCESS;
+/* case NSS_STATUS_TRYAGAIN: return NSLCD_RS_SMALLBUF; */
+ default: return NSLCD_RESULT_UNAVAIL;
+ }
+}
+
/*
* General entry point for enumeration routines.
* This should really use the asynchronous LDAP search API to avoid