summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2010-12-30 12:09:10 +0000
committerArthur de Jong <arthur@arthurdejong.org>2010-12-30 12:09:10 +0000
commitd99781bdf175fd7b66d37741c3acf33ca9331b49 (patch)
treee14002ff9747454aaba35105a783f0df1fe12204
parente985efa83458e1cc9c2bcb12e3cc10b6526c3399 (diff)
move Solaris specific NSS functions to separate file
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1350 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r--nss/Makefile.am7
-rw-r--r--nss/common.c34
-rw-r--r--nss/solnss.c49
3 files changed, 53 insertions, 37 deletions
diff --git a/nss/Makefile.am b/nss/Makefile.am
index d16eba6..0fddbe7 100644
--- a/nss/Makefile.am
+++ b/nss/Makefile.am
@@ -31,11 +31,12 @@ nss_ldap_so_SOURCES = common.c common.h prototypes.h \
EXTRA_nss_ldap_so_SOURCES = aliases.c ethers.c group.c hosts.c netgroup.c \
networks.c passwd.c protocols.c rpc.c services.c \
shadow.c
-nss_ldap_so_DEPENDENCIES = $(NSS_MODULE_OBJS)
-nss_ldap_so_LDADD = $(NSS_MODULE_OBJS) ../common/libtio.a ../common/libprot.a
+nss_ldap_so_DEPENDENCIES = $(NSS_MODULE_OBJS) solnss.$(OBJEXT)
+nss_ldap_so_LDADD = $(NSS_MODULE_OBJS)
if NSS_FLAVOUR_SOLARIS
-nss_ldap_so_LDADD += ../common/libdict.a
+nss_ldap_so_LDADD += solnss.$(OBJEXT) ../common/libdict.a
endif
+nss_ldap_so_LDADD += ../common/libtio.a ../common/libprot.a
EXTRA_DIST = exports.glibc exports.solaris
diff --git a/nss/common.c b/nss/common.c
index 7a0f8e7..20a3136 100644
--- a/nss/common.c
+++ b/nss/common.c
@@ -19,38 +19,4 @@
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/solnss.c b/nss/solnss.c
new file mode 100644
index 0000000..5206e30
--- /dev/null
+++ b/nss/solnss.c
@@ -0,0 +1,49 @@
+/*
+ solnss.c - Solaris specific NSS interface functions
+
+ Copyright (C) 2010 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
+*/
+
+#include "config.h"
+
+#include <errno.h>
+
+#include "prototypes.h"
+#include "common.h"
+#include "compat/attrs.h"
+
+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;
+}