Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nslcd
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
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')
-rw-r--r--nslcd/common.c15
-rw-r--r--nslcd/common.h8
-rw-r--r--nslcd/ldap-nss.c15
3 files changed, 15 insertions, 23 deletions
diff --git a/nslcd/common.c b/nslcd/common.c
index d2400a4..bf0d1ea 100644
--- a/nslcd/common.c
+++ b/nslcd/common.c
@@ -43,18 +43,3 @@ int mysnprintf(char *buffer,size_t buflen,const char *format, ...)
/* check if the string was completely written */
return ((res<0)||(((size_t)res)>=buflen));
}
-
-/* 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 */
-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;
- }
-}
diff --git a/nslcd/common.h b/nslcd/common.h
index 318c4ef..71282a8 100644
--- a/nslcd/common.h
+++ b/nslcd/common.h
@@ -29,14 +29,6 @@
#include "common/tio.h"
#include "compat/attrs.h"
-/* translates a nss code (as defined in nss.h) to a
- nslcd return code (as defined in nslcd.h) */
-/* FIXME: this is a temporary hack, get rid of it */
-#include <nss.h>
-int nss2nslcd(enum nss_status code)
- PURE MUST_USE;
-
-
/* macros for basic read and write operations, the following
ERROR_OUT* marcos define the action taken on errors
the stream is not closed because the caller closes the
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