diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2006-10-25 17:11:36 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2006-10-25 17:11:36 +0200 |
commit | b586bf84c0bd966abf5cb3d26fa956353d77f9e1 (patch) | |
tree | 1f1ea739a95397ccd9239ac28654d0699210e6e8 /nss/common.c | |
parent | ef0b1593cdb41e6cbd484bc16e02a21a2fa6b673 (diff) |
add some basic minimal NSS code that can be generated from macros
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@24 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nss/common.c')
-rw-r--r-- | nss/common.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/nss/common.c b/nss/common.c new file mode 100644 index 0000000..4aa1878 --- /dev/null +++ b/nss/common.c @@ -0,0 +1,20 @@ + +#include <nss.h> + +#include "nslcd-client.h" +#include "common.h" + +/* translates a nsklcd return code (as defined in nslcd.h) to + a nss code (as defined in nss.h) */ +enum nss_status nslcd2nss(int code) +{ + switch (code) + { + case NSLCD_RS_UNAVAIL: return NSS_STATUS_UNAVAIL; + case NSLCD_RS_NOTFOUND: return NSS_STATUS_NOTFOUND; + case NSLCD_RS_SUCCESS: return NSS_STATUS_SUCCESS; + case NSLCD_RS_SMALLBUF: return NSS_STATUS_TRYAGAIN; + default: return NSS_STATUS_UNAVAIL; + } +} + |