From 0e34be5958a08db6dc02c918dce0fa5f25d5fd6b Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sat, 8 Sep 2007 21:37:03 +0000 Subject: move nss2nslcd() to ldap-nss.c git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@387 ef36b2f9-881f-0410-afb5-c4e39611909c --- nslcd/ldap-nss.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'nslcd/ldap-nss.c') 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 -- cgit v1.2.3