summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2012-09-14 18:57:04 +0000
committerArthur de Jong <arthur@arthurdejong.org>2012-09-14 18:57:04 +0000
commit07e9509a375c80969fe0a69b8887dacdc17d35b8 (patch)
tree840c4b20b8eed4bf2bef4e078ce85f089bd00b96
parentc570664b6a5c3b68b672050c2814c3e231ea0c5e (diff)
use the standard constructor and destructor eventhough be->fp isn't used
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1765 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r--nss/ethers.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/nss/ethers.c b/nss/ethers.c
index d19cad8..f746045 100644
--- a/nss/ethers.c
+++ b/nss/ethers.c
@@ -158,14 +158,8 @@ static nss_status_t ethers_getntohost(nss_backend_t UNUSED(*be),void *args)
read_result(fp,args,1));
}
-static nss_status_t ethers_destructor(nss_backend_t *be,void UNUSED(*args))
-{
- free(be);
- return NSS_STATUS_SUCCESS;
-}
-
static nss_backend_op_t ethers_ops[]={
- ethers_destructor,
+ nss_ldap_destructor,
ethers_gethostton,
ethers_getntohost
};
@@ -173,12 +167,7 @@ static nss_backend_op_t ethers_ops[]={
nss_backend_t *_nss_ldap_ethers_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=ethers_ops;
- be->n_ops=sizeof(ethers_ops)/sizeof(nss_backend_op_t);
- return be;
+ return nss_ldap_constructor(ethers_ops,sizeof(ethers_ops));
}
#endif /* NSS_FLAVOUR_SOLARIS */