nss-pam-ldapd commit: r1812 - nss-pam-ldapd/nss
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
nss-pam-ldapd commit: r1812 - nss-pam-ldapd/nss
- From: Commits of the nss-pam-ldapd project <nss-pam-ldapd-commits [at] lists.arthurdejong.org>
- To: nss-pam-ldapd-commits [at] lists.arthurdejong.org
- Reply-to: nss-pam-ldapd-users [at] lists.arthurdejong.org
- Subject: nss-pam-ldapd commit: r1812 - nss-pam-ldapd/nss
- Date: Sun, 28 Oct 2012 21:13:43 +0100 (CET)
Author: arthur
Date: Sun Oct 28 21:13:43 2012
New Revision: 1812
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1812&view=revision
Log:
refactor the read_result() functions into a common macro and move all the
Solaris-specific definitions to solnss.h
Added:
nss-pam-ldapd/nss/solnss.h
Modified:
nss-pam-ldapd/nss/Makefile.am
nss-pam-ldapd/nss/common.h
nss-pam-ldapd/nss/group.c
nss-pam-ldapd/nss/hosts.c
nss-pam-ldapd/nss/networks.c
nss-pam-ldapd/nss/passwd.c
nss-pam-ldapd/nss/protocols.c
nss-pam-ldapd/nss/rpc.c
nss-pam-ldapd/nss/services.c
nss-pam-ldapd/nss/shadow.c
Modified: nss-pam-ldapd/nss/Makefile.am
==============================================================================
--- nss-pam-ldapd/nss/Makefile.am Sun Oct 28 20:14:23 2012 (r1811)
+++ nss-pam-ldapd/nss/Makefile.am Sun Oct 28 21:13:43 2012 (r1812)
@@ -25,7 +25,7 @@
AM_CPPFLAGS=-I$(top_srcdir)
AM_CFLAGS = -fPIC
-nss_ldap_so_SOURCES = common.c common.h prototypes.h \
+nss_ldap_so_SOURCES = common.c common.h prototypes.h solnss.h \
../nslcd.h ../common/nslcd-prot.h \
../compat/attrs.h
EXTRA_nss_ldap_so_SOURCES = aliases.c ethers.c group.c hosts.c netgroup.c \
Modified: nss-pam-ldapd/nss/common.h
==============================================================================
--- nss-pam-ldapd/nss/common.h Sun Oct 28 20:14:23 2012 (r1811)
+++ nss-pam-ldapd/nss/common.h Sun Oct 28 21:13:43 2012 (r1812)
@@ -31,6 +31,10 @@
#include "compat/attrs.h"
#include "compat/nss_compat.h"
+#ifdef NSS_FLAVOUR_SOLARIS
+#include "solnss.h"
+#endif /* NSS_FLAVOUR_SOLARIS */
+
/* These are macros for handling read and write problems, they are
NSS specific due to the return code so are defined here. They
genrally close the open file, set an error code and return with
@@ -90,49 +94,6 @@
#endif /* NSS_FLAVOUR_GLIBC */
-#ifdef NSS_FLAVOUR_SOLARIS
-
-/* extra definitions we need (Solaris NSS functions don't pass errno)
- also clear the output values */
-#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
-#define NSS_EXTRA_DEFS \
- int *errnop=&(errno); \
- NSS_ARGS(args)->returnval=NULL; \
- NSS_ARGS(args)->returnlen=0; \
- NSS_ARGS(args)->erange=0; \
- NSS_ARGS(args)->h_errno=0;
-#else /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
-#define NSS_EXTRA_DEFS \
- int *errnop=&(errno); \
- NSS_ARGS(args)->returnval=NULL; \
- NSS_ARGS(args)->erange=0; \
- NSS_ARGS(args)->h_errno=0;
-#endif /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
-
-/* check validity of passed buffer (Solaris flavour) */
-#define NSS_BUFCHECK \
- if ((NSS_ARGS(args)->buf.buffer==NULL)||(NSS_ARGS(args)->buf.buflen<=0)) \
- { \
- NSS_ARGS(args)->erange=1; \
- return NSS_STATUS_TRYAGAIN; \
- }
-
-/* this is the backend structure for Solaris */
-struct nss_ldap_backend
-{
- nss_backend_op_t *ops; /* function-pointer table */
- int n_ops; /* number of function pointers */
- TFILE *fp; /* the file pointer for {set,get,end}ent() functions */
-};
-
-/* constructor for LDAP backends */
-nss_backend_t *nss_ldap_constructor(nss_backend_op_t *ops,size_t sizeofops);
-
-/* destructor for LDAP backends */
-nss_status_t nss_ldap_destructor(nss_backend_t *be,void UNUSED(*args));
-
-#endif /* NSS_FLAVOUR_SOLARIS */
-
/* The following macros to automatically generate get..byname(),
get..bynumber(), setent(), getent() and endent() function
bodies. These functions have very common code so this can
Modified: nss-pam-ldapd/nss/group.c
==============================================================================
--- nss-pam-ldapd/nss/group.c Sun Oct 28 20:14:23 2012 (r1811)
+++ nss-pam-ldapd/nss/group.c Sun Oct 28 21:13:43 2012 (r1812)
@@ -215,40 +215,7 @@
static nss_status_t read_result(TFILE *fp,nss_XbyY_args_t *args)
{
- nss_status_t retv;
-#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
- struct group result;
- char *buffer;
- /* try to return in string format if requested */
- if (args->buf.result==NULL)
- {
- /* read the entry into a temporary buffer */
- buffer=(char *)malloc(args->buf.buflen);
- if (buffer==NULL)
- return NSS_STATUS_UNAVAIL;
- retv=read_group(fp,&result,buffer,args->buf.buflen,&args->erange);
- /* format to string */
- if (retv==NSS_STATUS_SUCCESS)
- if (group2str(&result,args->buf.buffer,args->buf.buflen)==NULL)
- {
- args->erange=1;
- retv=NSS_NOTFOUND;
- }
- /* clean up and return result */
- free(buffer);
- if (retv!=NSS_STATUS_SUCCESS)
- return retv;
- args->returnval=args->buf.buffer;
- args->returnlen=strlen(args->returnval);
- return NSS_STATUS_SUCCESS;
- }
-#endif /* HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
- /* read the entry */
-
retv=read_group(fp,args->buf.result,args->buf.buffer,args->buf.buflen,&args->erange);
- if (retv!=NSS_STATUS_SUCCESS)
- return retv;
- args->returnval=args->buf.result;
- return NSS_STATUS_SUCCESS;
+ READ_RESULT(group,&args->erange);
}
static nss_status_t group_getgrnam(nss_backend_t UNUSED(*be),void *args)
Modified: nss-pam-ldapd/nss/hosts.c
==============================================================================
--- nss-pam-ldapd/nss/hosts.c Sun Oct 28 20:14:23 2012 (r1811)
+++ nss-pam-ldapd/nss/hosts.c Sun Oct 28 21:13:43 2012 (r1812)
@@ -250,43 +250,7 @@
static nss_status_t read_result(TFILE *fp,int af,int retry,nss_XbyY_args_t
*args)
{
- nss_status_t retv;
-#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
- struct hostent result;
- char *buffer;
- /* try to return in string format if requested */
- if (args->buf.result==NULL)
- {
- /* read the entry into a temporary buffer*/
- buffer=(char *)malloc(args->buf.buflen);
- if (buffer==NULL)
- return NSS_STATUS_UNAVAIL;
-
retv=read_hostent(fp,&result,buffer,args->buf.buflen,&args->erange,&args->h_errno,af,retry);
- if (retv!=NSS_STATUS_SUCCESS)
- return retv;
- /* format to string */
- if (retv==NSS_STATUS_SUCCESS)
- if (hostent2str(&result,args->buf.buffer,args->buf.buflen)==NULL)
- {
- args->erange=1;
- retv=NSS_NOTFOUND;
- }
- /* clean up and return result */
- free(buffer);
- if (retv!=NSS_STATUS_SUCCESS)
- return retv;
- args->returnval=args->buf.buffer;
- args->returnlen=strlen(args->returnval);
- return NSS_STATUS_SUCCESS;
- }
-#endif /* HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
- /* read the entry */
- retv=read_hostent(fp,args->buf.result,args->buf.buffer,args->buf.buflen,
- &args->erange,&args->h_errno,af,retry);
- if (retv!=NSS_STATUS_SUCCESS)
- return retv;
- args->returnval=args->buf.result;
- return NSS_STATUS_SUCCESS;
+ READ_RESULT(hostent,&args->erange,&args->h_errno,af,retry);
}
/* hack to set the correct h_errno */
Modified: nss-pam-ldapd/nss/networks.c
==============================================================================
--- nss-pam-ldapd/nss/networks.c Sun Oct 28 20:14:23 2012 (r1811)
+++ nss-pam-ldapd/nss/networks.c Sun Oct 28 21:13:43 2012 (r1812)
@@ -185,40 +185,7 @@
static nss_status_t read_result(TFILE *fp,nss_XbyY_args_t *args)
{
- nss_status_t retv;
-#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
- struct netent result;
- char *buffer;
- /* try to return in string format if requested */
- if (args->buf.result==NULL)
- {
- /* read the entry into a temporary buffer */
- buffer=(char *)malloc(args->buf.buflen);
- if (buffer==NULL)
- return NSS_STATUS_UNAVAIL;
-
retv=read_netent(fp,&result,buffer,args->buf.buflen,&args->erange,&args->h_errno);
- /* format to string */
- if (retv==NSS_STATUS_SUCCESS)
- if (netent2str(&result,args->buf.buffer,args->buf.buflen)==NULL)
- {
- args->erange=1;
- retv=NSS_NOTFOUND;
- }
- /* clean up and return result */
- free(buffer);
- if (retv!=NSS_STATUS_SUCCESS)
- return retv;
- args->returnval=args->buf.buffer;
- args->returnlen=strlen(args->returnval);
- return NSS_STATUS_SUCCESS;
- }
-#endif /* HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
- /* read the entry */
-
retv=read_netent(fp,args->buf.result,args->buf.buffer,args->buf.buflen,&args->erange,&args->h_errno);
- if (retv!=NSS_STATUS_SUCCESS)
- return retv;
- args->returnval=args->buf.result;
- return NSS_STATUS_SUCCESS;
+ READ_RESULT(netent,&args->erange,&args->h_errno);
}
/* more of a dirty hack */
Modified: nss-pam-ldapd/nss/passwd.c
==============================================================================
--- nss-pam-ldapd/nss/passwd.c Sun Oct 28 20:14:23 2012 (r1811)
+++ nss-pam-ldapd/nss/passwd.c Sun Oct 28 21:13:43 2012 (r1812)
@@ -113,40 +113,7 @@
static nss_status_t read_result(TFILE *fp,nss_XbyY_args_t *args)
{
- nss_status_t retv;
-#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
- struct passwd result;
- char *buffer;
- /* try to return in string format if requested */
- if (args->buf.result==NULL)
- {
- /* read the entry into a temporary buffer */
- buffer=(char *)malloc(args->buf.buflen);
- if (buffer==NULL)
- return NSS_STATUS_UNAVAIL;
- retv=read_passwd(fp,&result,buffer,args->buf.buflen,&args->erange);
- /* format to string */
- if (retv==NSS_STATUS_SUCCESS)
- if (passwd2str(&result,args->buf.buffer,args->buf.buflen)==NULL)
- {
- args->erange=1;
- retv=NSS_NOTFOUND;
- }
- /* clean up and return result */
- free(buffer);
- if (retv!=NSS_STATUS_SUCCESS)
- return retv;
- args->returnval=args->buf.buffer;
- args->returnlen=strlen(args->returnval);
- return NSS_STATUS_SUCCESS;
- }
-#endif /* HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
- /* read the entry */
-
retv=read_passwd(fp,args->buf.result,args->buf.buffer,args->buf.buflen,&args->erange);
- if (retv!=NSS_STATUS_SUCCESS)
- return retv;
- args->returnval=args->buf.result;
- return NSS_STATUS_SUCCESS;
+ READ_RESULT(passwd,&args->erange);
}
static nss_status_t passwd_getpwnam(nss_backend_t UNUSED(*be),void *args)
Modified: nss-pam-ldapd/nss/protocols.c
==============================================================================
--- nss-pam-ldapd/nss/protocols.c Sun Oct 28 20:14:23 2012 (r1811)
+++ nss-pam-ldapd/nss/protocols.c Sun Oct 28 21:13:43 2012 (r1812)
@@ -115,40 +115,7 @@
static nss_status_t read_result(TFILE *fp,nss_XbyY_args_t *args)
{
- nss_status_t retv;
-#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
- struct protoent result;
- char *buffer;
- /* try to return in string format if requested */
- if (args->buf.result==NULL)
- {
- /* read the entry into a temporary buffer */
- buffer=(char *)malloc(args->buf.buflen);
- if (buffer==NULL)
- return NSS_STATUS_UNAVAIL;
- retv=read_protoent(fp,&result,buffer,args->buf.buflen,&args->erange);
- /* format to string */
- if (retv==NSS_STATUS_SUCCESS)
- if (protoent2str(&result,args->buf.buffer,args->buf.buflen)==NULL)
- {
- args->erange=1;
- retv=NSS_NOTFOUND;
- }
- /* clean up and return result */
- free(buffer);
- if (retv!=NSS_STATUS_SUCCESS)
- return retv;
- args->returnval=args->buf.buffer;
- args->returnlen=strlen(args->returnval);
- return NSS_STATUS_SUCCESS;
- }
-#endif /* HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
- /* read the entry */
-
retv=read_protoent(fp,args->buf.result,args->buf.buffer,args->buf.buflen,&args->erange);
- if (retv!=NSS_STATUS_SUCCESS)
- return retv;
- args->returnval=args->buf.result;
- return NSS_STATUS_SUCCESS;
+ READ_RESULT(protoent,&args->erange);
}
static nss_status_t protocols_getprotobyname(nss_backend_t UNUSED(*be),void
*args)
Modified: nss-pam-ldapd/nss/rpc.c
==============================================================================
--- nss-pam-ldapd/nss/rpc.c Sun Oct 28 20:14:23 2012 (r1811)
+++ nss-pam-ldapd/nss/rpc.c Sun Oct 28 21:13:43 2012 (r1812)
@@ -115,40 +115,7 @@
static nss_status_t read_result(TFILE *fp,nss_XbyY_args_t *args)
{
- nss_status_t retv;
-#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
- struct rpcent result;
- char *buffer;
- /* try to return in string format if requested */
- if (args->buf.result==NULL)
- {
- /* read the entry into a temporary buffer */
- buffer=(char *)malloc(args->buf.buflen);
- if (buffer==NULL)
- return NSS_STATUS_UNAVAIL;
- retv=read_rpcent(fp,&result,buffer,args->buf.buflen,&args->erange);
- /* format to string */
- if (retv==NSS_STATUS_SUCCESS)
- if (rpcent2str(&result,args->buf.buffer,args->buf.buflen)==NULL)
- {
- args->erange=1;
- retv=NSS_NOTFOUND;
- }
- /* clean up and return result */
- free(buffer);
- if (retv!=NSS_STATUS_SUCCESS)
- return retv;
- args->returnval=args->buf.buffer;
- args->returnlen=strlen(args->returnval);
- return NSS_STATUS_SUCCESS;
- }
-#endif /* HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
- /* read the entry */
-
retv=read_rpcent(fp,args->buf.result,args->buf.buffer,args->buf.buflen,&args->erange);
- if (retv!=NSS_STATUS_SUCCESS)
- return retv;
- args->returnval=args->buf.result;
- return NSS_STATUS_SUCCESS;
+ READ_RESULT(rpcent,&args->erange);
}
static nss_status_t rpc_getrpcbyname(nss_backend_t UNUSED(*be),void *args)
Modified: nss-pam-ldapd/nss/services.c
==============================================================================
--- nss-pam-ldapd/nss/services.c Sun Oct 28 20:14:23 2012 (r1811)
+++ nss-pam-ldapd/nss/services.c Sun Oct 28 21:13:43 2012 (r1812)
@@ -119,40 +119,7 @@
static nss_status_t read_result(TFILE *fp,nss_XbyY_args_t *args)
{
- nss_status_t retv;
-#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
- struct servent result;
- char *buffer;
- /* try to return in string format if requested */
- if (args->buf.result==NULL)
- {
- /* read the entry into a temporary buffer */
- buffer=(char *)malloc(args->buf.buflen);
- if (buffer==NULL)
- return NSS_STATUS_UNAVAIL;
- retv=read_servent(fp,&result,buffer,args->buf.buflen,&args->erange);
- /* format to string */
- if (retv==NSS_STATUS_SUCCESS)
- if (servent2str(&result,args->buf.buffer,args->buf.buflen)==NULL)
- {
- args->erange=1;
- retv=NSS_NOTFOUND;
- }
- /* clean up and return result */
- free(buffer);
- if (retv!=NSS_STATUS_SUCCESS)
- return retv;
- args->returnval=args->buf.buffer;
- args->returnlen=strlen(args->returnval);
- return NSS_STATUS_SUCCESS;
- }
-#endif /* HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
- /* read the entry */
-
retv=read_servent(fp,args->buf.result,args->buf.buffer,args->buf.buflen,&args->erange);
- if (retv!=NSS_STATUS_SUCCESS)
- return retv;
- args->returnval=args->buf.result;
- return NSS_STATUS_SUCCESS;
+ READ_RESULT(servent,&args->erange);
}
static nss_status_t services_getservbyname(nss_backend_t UNUSED(*be),void
*args)
Modified: nss-pam-ldapd/nss/shadow.c
==============================================================================
--- nss-pam-ldapd/nss/shadow.c Sun Oct 28 20:14:23 2012 (r1811)
+++ nss-pam-ldapd/nss/shadow.c Sun Oct 28 21:13:43 2012 (r1812)
@@ -123,40 +123,7 @@
static nss_status_t read_result(TFILE *fp,nss_XbyY_args_t *args)
{
- nss_status_t retv;
-#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
- struct spwd result;
- char *buffer;
- /* try to return in string format if requested */
- if (args->buf.result==NULL)
- {
- /* read the entry into a temporary buffer */
- buffer=(char *)malloc(args->buf.buflen);
- if (buffer==NULL)
- return NSS_STATUS_UNAVAIL;
- retv=read_spwd(fp,&result,buffer,args->buf.buflen,&args->erange);
- /* format to string */
- if (retv==NSS_STATUS_SUCCESS)
- if (spwd2str(&result,args->buf.buffer,args->buf.buflen)==NULL)
- {
- args->erange=1;
- retv=NSS_NOTFOUND;
- }
- /* clean up and return result */
- free(buffer);
- if (retv!=NSS_STATUS_SUCCESS)
- return retv;
- args->returnval=args->buf.buffer;
- args->returnlen=strlen(args->returnval);
- return NSS_STATUS_SUCCESS;
- }
-#endif /* HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
- /* read the entry */
-
retv=read_spwd(fp,args->buf.result,args->buf.buffer,args->buf.buflen,&args->erange);
- if (retv!=NSS_STATUS_SUCCESS)
- return retv;
- args->returnval=args->buf.result;
- return NSS_STATUS_SUCCESS;
+ READ_RESULT(spwd,&args->erange);
}
static nss_status_t shadow_getspnam(nss_backend_t UNUSED(*be),void *args)
Added: nss-pam-ldapd/nss/solnss.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ nss-pam-ldapd/nss/solnss.h Sun Oct 28 21:13:43 2012 (r1812)
@@ -0,0 +1,112 @@
+/*
+ solnss.h - common functions for NSS lookups on Solaris
+
+ Copyright (C) 2012 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
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA
+*/
+
+#ifndef NSS__SOLNSS_H
+#define NSS__SOLNSS_H 1
+#ifdef NSS_FLAVOUR_SOLARIS
+
+/* extra definitions we need (Solaris NSS functions don't pass errno)
+ also clear the output values */
+#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
+#define NSS_EXTRA_DEFS \
+ int *errnop=&(errno); \
+ NSS_ARGS(args)->returnval=NULL; \
+ NSS_ARGS(args)->returnlen=0; \
+ NSS_ARGS(args)->erange=0; \
+ NSS_ARGS(args)->h_errno=0;
+#else /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
+#define NSS_EXTRA_DEFS \
+ int *errnop=&(errno); \
+ NSS_ARGS(args)->returnval=NULL; \
+ NSS_ARGS(args)->erange=0; \
+ NSS_ARGS(args)->h_errno=0;
+#endif /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
+
+/* check validity of passed buffer (Solaris flavour) */
+#define NSS_BUFCHECK \
+ if ((NSS_ARGS(args)->buf.buffer==NULL)||(NSS_ARGS(args)->buf.buflen<=0)) \
+ { \
+ NSS_ARGS(args)->erange=1; \
+ return NSS_STATUS_TRYAGAIN; \
+ }
+
+/* wrapper function body for read_xxxent that does the buffer handling,
+ return code handling and conversion to strings for nscd
+ (also see READ_RESULT_STRING below) */
+#define READ_RESULT(ent,extra...) \
+ nss_status_t retv; \
+ READ_RESULT_STRING(ent,##extra) \
+ /* read the entry */ \
+
retv=read_##ent(fp,args->buf.result,args->buf.buffer,args->buf.buflen,##extra);
\
+ if (retv!=NSS_STATUS_SUCCESS) \
+ return retv; \
+ args->returnval=args->buf.result; \
+ return NSS_STATUS_SUCCESS;
+
+/* provide result handling for when libc (or nscd) expects the returned
+ values to be in string format */
+#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
+#define READ_RESULT_STRING(ent,extra...) \
+ struct ent result; \
+ char *buffer; \
+ /* try to return in string format if requested */ \
+ if (args->buf.result==NULL) \
+ { \
+ /* read the entry into a temporary buffer */ \
+ buffer=(char *)malloc(args->buf.buflen); \
+ if (buffer==NULL) \
+ return NSS_STATUS_UNAVAIL; \
+ retv=read_##ent(fp,&result,buffer,args->buf.buflen,##extra); \
+ /* format to string */ \
+ if (retv==NSS_STATUS_SUCCESS) \
+ if (ent##2str(&result,args->buf.buffer,args->buf.buflen)==NULL) \
+ { \
+ args->erange=1; \
+ retv=NSS_NOTFOUND; \
+ } \
+ /* clean up and return result */ \
+ free(buffer); \
+ if (retv!=NSS_STATUS_SUCCESS) \
+ return retv; \
+ args->returnval=args->buf.buffer; \
+ args->returnlen=strlen(args->returnval); \
+ return NSS_STATUS_SUCCESS; \
+ }
+#else /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
+#define READ_RESULT_STRING(ent,extra...) ;
+#endif /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
+
+/* this is the backend structure for Solaris */
+struct nss_ldap_backend
+{
+ nss_backend_op_t *ops; /* function-pointer table */
+ int n_ops; /* number of function pointers */
+ TFILE *fp; /* the file pointer for {set,get,end}ent() functions */
+};
+
+/* constructor for LDAP backends */
+nss_backend_t *nss_ldap_constructor(nss_backend_op_t *ops,size_t sizeofops);
+
+/* destructor for LDAP backends */
+nss_status_t nss_ldap_destructor(nss_backend_t *be,void UNUSED(*args));
+
+#endif /* NSS_FLAVOUR_SOLARIS */
+#endif /* not NSS__COMMON_H */
--
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/
- nss-pam-ldapd commit: r1812 - nss-pam-ldapd/nss,
Commits of the nss-pam-ldapd project