Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nss
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2010-12-16 22:50:51 +0100
committerArthur de Jong <arthur@arthurdejong.org>2010-12-16 22:50:51 +0100
commitf67d6f67b84daa6acd33dd8f4192a72bc46c3a63 (patch)
tree5a2a84e90cbf80cd3f2ca1616a2d27b694c51d91 /nss
parent08f01639626bb2ec2537df7d9f8c5459867c0afb (diff)
switch to a common back-end with a common constructor and destructor and put file pointer shared between {set,get,end}ent() calls in there
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1333 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nss')
-rw-r--r--nss/common.c34
-rw-r--r--nss/common.h20
-rw-r--r--nss/group.c32
-rw-r--r--nss/hosts.c41
-rw-r--r--nss/networks.c34
-rw-r--r--nss/passwd.c32
-rw-r--r--nss/protocols.c35
-rw-r--r--nss/rpc.c32
-rw-r--r--nss/services.c32
-rw-r--r--nss/shadow.c32
10 files changed, 136 insertions, 188 deletions
diff --git a/nss/common.c b/nss/common.c
index 20a3136..7a0f8e7 100644
--- a/nss/common.c
+++ b/nss/common.c
@@ -19,4 +19,38 @@
02110-1301 USA
*/
+#include "config.h"
+
+#include <errno.h>
+
+#include "prototypes.h"
+#include "common.h"
+#include "compat/attrs.h"
+
+/* global symbol to prevent NSS name lookups using this module */
int _nss_ldap_enablelookups=1;
+
+#ifdef NSS_FLAVOUR_SOLARIS
+
+nss_backend_t *nss_ldap_constructor(nss_backend_op_t *ops,size_t sizeofops)
+{
+ struct nss_ldap_backend *ldapbe;
+ ldapbe=(struct nss_ldap_backend *)malloc(sizeof(struct nss_ldap_backend));
+ if (ldapbe==NULL)
+ return NULL;
+ ldapbe->ops=ops;
+ ldapbe->n_ops=sizeofops/sizeof(nss_backend_op_t);
+ ldapbe->fp=NULL;
+ return (nss_backend_t *)ldapbe;
+}
+
+nss_status_t nss_ldap_destructor(nss_backend_t *be,void UNUSED(*args))
+{
+ struct nss_ldap_backend *ldapbe=(struct nss_ldap_backend *)be;
+ if (ldapbe->fp!=NULL)
+ (void)tio_close(ldapbe->fp);
+ free(ldapbe);
+ return NSS_STATUS_SUCCESS;
+}
+
+#endif /* NSS_FLAVOUR_SOLARIS */
diff --git a/nss/common.h b/nss/common.h
index 7a3edcf..74ba519 100644
--- a/nss/common.h
+++ b/nss/common.h
@@ -104,6 +104,26 @@
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));
+
+extern TFILE *xxfp;
+
+/* easy way to get fp from back-end */
+/* #define LDAP_GET_FP(be) (((struct nss_ldap_backend*)(be))->fp) */
+#define LDAP_BE(be) ((struct nss_ldap_backend*)(be))
+
#endif /* NSS_FLAVOUR_SOLARIS */
/* The following macros to automatically generate get..byname(),
diff --git a/nss/group.c b/nss/group.c
index 7427e2d..b460445 100644
--- a/nss/group.c
+++ b/nss/group.c
@@ -247,23 +247,20 @@ static nss_status_t group_getgrgid(nss_backend_t UNUSED(*be),void *args)
READ_RESULT(fp));
}
-/* thread-local file pointer to an ongoing request */
-static __thread TFILE *grentfp;
-
-static nss_status_t group_setgrent(nss_backend_t UNUSED(*be),void UNUSED(*args))
+static nss_status_t group_setgrent(nss_backend_t *be,void UNUSED(*args))
{
- NSS_SETENT(grentfp);
+ NSS_SETENT(LDAP_BE(be)->fp);
}
-static nss_status_t group_getgrent(nss_backend_t UNUSED(*be),void *args)
+static nss_status_t group_getgrent(nss_backend_t *be,void *args)
{
- NSS_GETENT(grentfp,NSLCD_ACTION_GROUP_ALL,
- READ_RESULT(grentfp));
+ NSS_GETENT(LDAP_BE(be)->fp,NSLCD_ACTION_GROUP_ALL,
+ READ_RESULT((LDAP_BE(be)->fp)));
}
-static nss_status_t group_endgrent(nss_backend_t UNUSED(*be),void UNUSED(*args))
+static nss_status_t group_endgrent(nss_backend_t *be,void UNUSED(*args))
{
- NSS_ENDENT(grentfp);
+ NSS_ENDENT(LDAP_BE(be)->fp);
}
/*
@@ -282,14 +279,8 @@ static nss_status_t group_getgroupsbymember(nss_backend_t UNUSED(*be),void *args
argp->numgids=(int)start;);
}
-static nss_status_t group_destructor(nss_backend_t *be,void UNUSED(*args))
-{
- free(be);
- return NSS_STATUS_SUCCESS;
-}
-
static nss_backend_op_t group_ops[]={
- group_destructor,
+ nss_ldap_destructor,
group_endgrent,
group_setgrent,
group_getgrent,
@@ -301,12 +292,7 @@ static nss_backend_op_t group_ops[]={
nss_backend_t *_nss_ldap_group_constr(const char UNUSED(*db_name),
const char UNUSED(*src_name),const char UNUSED(*cfg_args))
{
- nss_backend_t *be;
- if (!(be=(nss_backend_t *)malloc(sizeof(*be))))
- return NULL;
- be->ops=group_ops;
- be->n_ops=sizeof(group_ops)/sizeof(nss_backend_op_t);
- return (nss_backend_t *)be;
+ return nss_ldap_constructor(group_ops,sizeof(group_ops));
}
#endif /* NSS_FLAVOUR_SOLARIS */
diff --git a/nss/hosts.c b/nss/hosts.c
index 019e2b5..eda7dc5 100644
--- a/nss/hosts.c
+++ b/nss/hosts.c
@@ -242,6 +242,13 @@ nss_status_t _nss_ldap_endhostent(void)
#ifdef NSS_FLAVOUR_SOLARIS
+struct nss_ldap_hosts_backend
+{
+ nss_backend_op_t *ops;
+ int n_ops;
+ TFILE *fp;
+};
+
#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
static nss_status_t read_hoststring(TFILE *fp,nss_XbyY_args_t *args,int erronempty)
@@ -341,33 +348,24 @@ static nss_status_t hosts_gethostbyaddr(nss_backend_t UNUSED(*be),void *args)
READ_RESULT_ERRONEMPTY(fp));
}
-/* thread-local file pointer to an ongoing request */
-static __thread TFILE *hostentfp;
-
-static nss_status_t hosts_sethostent(nss_backend_t UNUSED(*be),void UNUSED(*args))
+static nss_status_t hosts_sethostent(nss_backend_t *be,void UNUSED(*args))
{
- NSS_SETENT(hostentfp);
+ NSS_SETENT(LDAP_BE(be)->fp);
}
-static nss_status_t hosts_gethostent(nss_backend_t UNUSED(*be),void *args)
+static nss_status_t hosts_gethostent(nss_backend_t *be,void *args)
{
- NSS_GETENT(hostentfp,NSLCD_ACTION_HOST_ALL,
- READ_RESULT_NEXTONEMPTY(hostentfp));
-}
-
-static nss_status_t hosts_endhostent(nss_backend_t UNUSED(*be),void UNUSED(*args))
-{
- NSS_ENDENT(hostentfp);
+ NSS_GETENT(LDAP_BE(be)->fp,NSLCD_ACTION_HOST_ALL,
+ READ_RESULT_NEXTONEMPTY(LDAP_BE(be)->fp));
}
-static nss_status_t hosts_destructor(nss_backend_t *be,void UNUSED(*args))
+static nss_status_t hosts_endhostent(nss_backend_t *be,void UNUSED(*args))
{
- free(be);
- return NSS_STATUS_SUCCESS;
+ NSS_ENDENT(LDAP_BE(be)->fp);
}
-static nss_backend_op_t host_ops[]={
- hosts_destructor,
+static nss_backend_op_t hosts_ops[]={
+ nss_ldap_destructor,
hosts_endhostent,
hosts_sethostent,
hosts_gethostent,
@@ -378,12 +376,7 @@ static nss_backend_op_t host_ops[]={
nss_backend_t *_nss_ldap_hosts_constr(const char UNUSED(*db_name),
const char UNUSED(*src_name),const char UNUSED(*cfg_args))
{
- nss_backend_t *be;
- if (!(be=(nss_backend_t *)malloc(sizeof(*be))))
- return NULL;
- be->ops=host_ops;
- be->n_ops=sizeof(host_ops)/sizeof(nss_backend_op_t);
- return (nss_backend_t *)be;
+ return nss_ldap_constructor(hosts_ops,sizeof(hosts_ops));
}
#endif /* NSS_FLAVOUR_SOLARIS */
diff --git a/nss/networks.c b/nss/networks.c
index 98b737b..1b407de 100644
--- a/nss/networks.c
+++ b/nss/networks.c
@@ -230,33 +230,24 @@ static nss_status_t networks_getnetbyaddr(nss_backend_t UNUSED(*be),void *args)
READ_RESULT(fp));
}
-/* thread-local file pointer to an ongoing request */
-static __thread TFILE *netentfp;
-
-static nss_status_t networks_setnetent(nss_backend_t UNUSED(*be),void UNUSED(*args))
-{
- NSS_SETENT(netentfp);
-}
-
-static nss_status_t networks_getnetent(nss_backend_t UNUSED(*be),void *args)
+static nss_status_t networks_setnetent(nss_backend_t *be,void UNUSED(*args))
{
- NSS_GETENT(netentfp,NSLCD_ACTION_NETWORK_ALL,
- READ_RESULT(netentfp));
+ NSS_SETENT(LDAP_BE(be)->fp);
}
-static nss_status_t networks_endnetent(nss_backend_t UNUSED(*be),void UNUSED(*args))
+static nss_status_t networks_getnetent(nss_backend_t *be,void *args)
{
- NSS_ENDENT(netentfp);
+ NSS_GETENT(LDAP_BE(be)->fp,NSLCD_ACTION_NETWORK_ALL,
+ READ_RESULT(LDAP_BE(be)->fp));
}
-static nss_status_t networks_destructor(nss_backend_t *be,void UNUSED(*args))
+static nss_status_t networks_endnetent(nss_backend_t *be,void UNUSED(*args))
{
- free(be);
- return NSS_STATUS_SUCCESS;
+ NSS_ENDENT(LDAP_BE(be)->fp);
}
-static nss_backend_op_t net_ops[]={
- networks_destructor,
+static nss_backend_op_t networks_ops[]={
+ nss_ldap_destructor,
networks_endnetent,
networks_setnetent,
networks_getnetent,
@@ -267,12 +258,7 @@ static nss_backend_op_t net_ops[]={
nss_backend_t *_nss_ldap_networks_constr(const char UNUSED(*db_name),
const char UNUSED(*src_name),const char UNUSED(*cfg_args))
{
- nss_backend_t *be;
- if (!(be=(nss_backend_t *)malloc(sizeof(*be))))
- return NULL;
- be->ops=net_ops;
- be->n_ops=sizeof(net_ops)/sizeof(nss_backend_op_t);
- return (nss_backend_t *)be;
+ return nss_ldap_constructor(networks_ops,sizeof(networks_ops));
}
#endif /* NSS_FLAVOUR_SOLARIS */
diff --git a/nss/passwd.c b/nss/passwd.c
index 28022b1..9681eb5 100644
--- a/nss/passwd.c
+++ b/nss/passwd.c
@@ -155,36 +155,27 @@ static nss_status_t passwd_getpwuid(nss_backend_t UNUSED(*be),void *args)
READ_RESULT(fp));
}
-/* thread-local file pointer to an ongoing request */
-static __thread TFILE *pwentfp;
-
/* open a connection to the nslcd and write the request */
-static nss_status_t passwd_setpwent(nss_backend_t UNUSED(*be),void UNUSED(*args))
+static nss_status_t passwd_setpwent(nss_backend_t *be,void UNUSED(*args))
{
- NSS_SETENT(pwentfp);
+ NSS_SETENT(LDAP_BE(be)->fp);
}
/* read password data from an opened stream */
-static nss_status_t passwd_getpwent(nss_backend_t UNUSED(*be),void *args)
+static nss_status_t passwd_getpwent(nss_backend_t *be,void *args)
{
- NSS_GETENT(pwentfp,NSLCD_ACTION_PASSWD_ALL,
- READ_RESULT(pwentfp));
+ NSS_GETENT(LDAP_BE(be)->fp,NSLCD_ACTION_PASSWD_ALL,
+ READ_RESULT(LDAP_BE(be)->fp));
}
/* close the stream opened with setpwent() above */
-static nss_status_t passwd_endpwent(nss_backend_t UNUSED(*be),void UNUSED(*args))
+static nss_status_t passwd_endpwent(nss_backend_t *be,void UNUSED(*args))
{
- NSS_ENDENT(pwentfp);
-}
-
-static nss_status_t passwd_destructor(nss_backend_t *be,void UNUSED(*args))
-{
- free(be);
- return NSS_STATUS_SUCCESS;
+ NSS_ENDENT(LDAP_BE(be)->fp);
}
static nss_backend_op_t passwd_ops[]={
- passwd_destructor,
+ nss_ldap_destructor,
passwd_endpwent,
passwd_setpwent,
passwd_getpwent,
@@ -195,12 +186,7 @@ static nss_backend_op_t passwd_ops[]={
nss_backend_t *_nss_ldap_passwd_constr(const char UNUSED(*db_name),
const char UNUSED(*src_name),const char UNUSED(*cfg_args))
{
- nss_backend_t *be;
- if (!(be=(nss_backend_t *)malloc(sizeof(*be))))
- return NULL;
- be->ops=passwd_ops;
- be->n_ops=sizeof(passwd_ops)/sizeof(nss_backend_op_t);
- return (nss_backend_t *)be;
+ return nss_ldap_constructor(passwd_ops,sizeof(passwd_ops));
}
#endif /* NSS_FLAVOUR_SOLARIS */
diff --git a/nss/protocols.c b/nss/protocols.c
index 5d61576..c641eaa 100644
--- a/nss/protocols.c
+++ b/nss/protocols.c
@@ -156,33 +156,24 @@ static nss_status_t protocols_getprotobynumber(nss_backend_t UNUSED(*be),void *a
READ_RESULT(fp));
}
-/* thread-local file pointer to an ongoing request */
-static __thread TFILE *protoentfp;
-
-static nss_status_t protocols_setprotoent(nss_backend_t UNUSED(*be),void UNUSED(*args))
-{
- NSS_SETENT(protoentfp);
-}
-
-static nss_status_t protocols_getprotoent(nss_backend_t UNUSED(*be),void *args)
+static nss_status_t protocols_setprotoent(nss_backend_t *be,void UNUSED(*args))
{
- NSS_GETENT(protoentfp,NSLCD_ACTION_PROTOCOL_ALL,
- READ_RESULT(protoentfp));
+ NSS_SETENT(LDAP_BE(be)->fp);
}
-static nss_status_t protocols_endprotoent(nss_backend_t UNUSED(*be),void UNUSED(*args))
+static nss_status_t protocols_getprotoent(nss_backend_t *be,void *args)
{
- NSS_ENDENT(protoentfp);
+ NSS_GETENT(LDAP_BE(be)->fp,NSLCD_ACTION_PROTOCOL_ALL,
+ READ_RESULT(LDAP_BE(be)->fp));
}
-static nss_status_t protocols_destructor(nss_backend_t *be,void UNUSED(*args))
+static nss_status_t protocols_endprotoent(nss_backend_t *be,void UNUSED(*args))
{
- free(be);
- return NSS_STATUS_SUCCESS;
+ NSS_ENDENT(LDAP_BE(be)->fp);
}
-static nss_backend_op_t proto_ops[]={
- protocols_destructor,
+static nss_backend_op_t protocols_ops[]={
+ nss_ldap_destructor,
protocols_endprotoent,
protocols_setprotoent,
protocols_getprotoent,
@@ -193,13 +184,7 @@ static nss_backend_op_t proto_ops[]={
nss_backend_t *_nss_ldap_protocols_constr(const char UNUSED(*db_name),
const char UNUSED(*src_name),const char UNUSED(*cfg_args))
{
- nss_backend_t *be;
- be=(nss_backend_t *)malloc(sizeof(*be));
- if (be==NULL)
- return NULL;
- be->ops=proto_ops;
- be->n_ops=sizeof(proto_ops)/sizeof(nss_backend_op_t);
- return (nss_backend_t *)be;
+ return nss_ldap_constructor(protocols_ops,sizeof(protocols_ops));
}
#endif /* NSS_FLAVOUR_SOLARIS */
diff --git a/nss/rpc.c b/nss/rpc.c
index 096cf94..cc1b12f 100644
--- a/nss/rpc.c
+++ b/nss/rpc.c
@@ -156,33 +156,24 @@ static nss_status_t rpc_getrpcbynumber(nss_backend_t UNUSED(*be),void *args)
READ_RESULT(fp));
}
-/* thread-local file pointer to an ongoing request */
-static __thread TFILE *rpcentfp;
-
-static nss_status_t rpc_setrpcent(nss_backend_t UNUSED(*be),void UNUSED(*args))
-{
- NSS_SETENT(rpcentfp);
-}
-
-static nss_status_t rpc_getrpcent(nss_backend_t UNUSED(*be),void *args)
+static nss_status_t rpc_setrpcent(nss_backend_t *be,void UNUSED(*args))
{
- NSS_GETENT(rpcentfp,NSLCD_ACTION_RPC_ALL,
- READ_RESULT(rpcentfp));
+ NSS_SETENT(LDAP_BE(be)->fp);
}
-static nss_status_t rpc_endrpcent(nss_backend_t UNUSED(*be),void UNUSED(*args))
+static nss_status_t rpc_getrpcent(nss_backend_t *be,void *args)
{
- NSS_ENDENT(rpcentfp);
+ NSS_GETENT(LDAP_BE(be)->fp,NSLCD_ACTION_RPC_ALL,
+ READ_RESULT(LDAP_BE(be)->fp));
}
-static nss_status_t rpc_destructor(nss_backend_t *be,void UNUSED(*args))
+static nss_status_t rpc_endrpcent(nss_backend_t *be,void UNUSED(*args))
{
- free(be);
- return NSS_STATUS_SUCCESS;
+ NSS_ENDENT(LDAP_BE(be)->fp);
}
static nss_backend_op_t rpc_ops[]={
- rpc_destructor,
+ nss_ldap_destructor,
rpc_endrpcent,
rpc_setrpcent,
rpc_getrpcent,
@@ -193,12 +184,7 @@ static nss_backend_op_t rpc_ops[]={
nss_backend_t *_nss_ldap_rpc_constr(const char UNUSED(*db_name),
const char UNUSED(*src_name),const char UNUSED(*cfg_args))
{
- nss_backend_t *be;
- if (!(be=(nss_backend_t *)malloc(sizeof(*be))))
- return NULL;
- be->ops=rpc_ops;
- be->n_ops=sizeof(rpc_ops)/sizeof(nss_backend_op_t);
- return (nss_backend_t *)be;
+ return nss_ldap_constructor(rpc_ops,sizeof(rpc_ops));
}
#endif /* NSS_FLAVOUR_SOLARIS */
diff --git a/nss/services.c b/nss/services.c
index 4583ba7..4d03d5c 100644
--- a/nss/services.c
+++ b/nss/services.c
@@ -162,33 +162,24 @@ static nss_status_t services_getservbyport(nss_backend_t UNUSED(*be),void *args)
READ_RESULT(fp));
}
-/* thread-local file pointer to an ongoing request */
-static __thread TFILE *serventfp;
-
-static nss_status_t services_setservent(nss_backend_t UNUSED(*be),void UNUSED(*args))
-{
- NSS_SETENT(serventfp);
-}
-
-static nss_status_t services_getservent(nss_backend_t UNUSED(*be),void *args)
+static nss_status_t services_setservent(nss_backend_t *be,void UNUSED(*args))
{
- NSS_GETENT(serventfp,NSLCD_ACTION_SERVICE_ALL,
- READ_RESULT(serventfp));
+ NSS_SETENT(LDAP_BE(be)->fp);
}
-static nss_status_t services_endservent(nss_backend_t UNUSED(*be),void UNUSED(*args))
+static nss_status_t services_getservent(nss_backend_t *be,void *args)
{
- NSS_ENDENT(serventfp);
+ NSS_GETENT(LDAP_BE(be)->fp,NSLCD_ACTION_SERVICE_ALL,
+ READ_RESULT(LDAP_BE(be)->fp));
}
-static nss_status_t services_destructor(nss_backend_t *be,void UNUSED(*args))
+static nss_status_t services_endservent(nss_backend_t *be,void UNUSED(*args))
{
- free(be);
- return NSS_STATUS_SUCCESS;
+ NSS_ENDENT(LDAP_BE(be)->fp);
}
static nss_backend_op_t services_ops[]={
- services_destructor,
+ nss_ldap_destructor,
services_endservent,
services_setservent,
services_getservent,
@@ -199,12 +190,7 @@ static nss_backend_op_t services_ops[]={
nss_backend_t *_nss_ldap_services_constr(const char UNUSED(*db_name),
const char UNUSED(*src_name),const char UNUSED(*cfg_args))
{
- nss_backend_t *be;
- if (!(be=(nss_backend_t *)malloc(sizeof(*be))))
- return NULL;
- be->ops=services_ops;
- be->n_ops=sizeof(services_ops)/sizeof(nss_backend_op_t);
- return (nss_backend_t *)be;
+ return nss_ldap_constructor(services_ops,sizeof(services_ops));
}
#endif /* NSS_FLAVOUR_SOLARIS */
diff --git a/nss/shadow.c b/nss/shadow.c
index 9bd84fc..d22af52 100644
--- a/nss/shadow.c
+++ b/nss/shadow.c
@@ -174,33 +174,24 @@ static nss_status_t shadow_getspnam(nss_backend_t UNUSED(*be),void *args)
READ_RESULT(fp));
}
-/* thread-local file pointer to an ongoing request */
-static __thread TFILE *spentfp;
-
-static nss_status_t shadow_setspent(nss_backend_t UNUSED(*be),void UNUSED(*args))
-{
- NSS_SETENT(spentfp);
-}
-
-static nss_status_t shadow_getspent(nss_backend_t UNUSED(*be),void *args)
+static nss_status_t shadow_setspent(nss_backend_t *be,void UNUSED(*args))
{
- NSS_GETENT(spentfp,NSLCD_ACTION_SHADOW_ALL,
- READ_RESULT(spentfp));
+ NSS_SETENT(LDAP_BE(be)->fp);
}
-static nss_status_t shadow_endspent(nss_backend_t UNUSED(*be),void UNUSED(*args))
+static nss_status_t shadow_getspent(nss_backend_t *be,void *args)
{
- NSS_ENDENT(spentfp);
+ NSS_GETENT(LDAP_BE(be)->fp,NSLCD_ACTION_SHADOW_ALL,
+ READ_RESULT(LDAP_BE(be)->fp));
}
-static nss_status_t shadow_destructor(nss_backend_t *be,void UNUSED(*args))
+static nss_status_t shadow_endspent(nss_backend_t *be,void UNUSED(*args))
{
- free(be);
- return NSS_STATUS_SUCCESS;
+ NSS_ENDENT(LDAP_BE(be)->fp);
}
static nss_backend_op_t shadow_ops[]={
- shadow_destructor,
+ nss_ldap_destructor,
shadow_endspent,
shadow_setspent,
shadow_getspent,
@@ -210,12 +201,7 @@ static nss_backend_op_t shadow_ops[]={
nss_backend_t *_nss_ldap_shadow_constr(const char UNUSED(*db_name),
const char UNUSED(*src_name),const char UNUSED(*cfg_args))
{
- nss_backend_t *be;
- if (!(be=(nss_backend_t *)malloc(sizeof(*be))))
- return NULL;
- be->ops=shadow_ops;
- be->n_ops=sizeof(shadow_ops)/sizeof(nss_backend_op_t);
- return (nss_backend_t *)be;
+ return nss_ldap_constructor(shadow_ops,sizeof(shadow_ops));
}
#endif /* NSS_FLAVOUR_SOLARIS */