lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1161 - in nss-pam-ldapd: . nslcd nss

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd commit: r1161 - in nss-pam-ldapd: . nslcd nss



Author: arthur
Date: Wed Jul  7 22:21:28 2010
New Revision: 1161
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?view=rev&revision=1161

Log:
allow configuring NSS module's SONAME from configure and use this in nslcd to 
dlopen() the correct library (thanks to Alexander V. Chernikov for the idea)

Modified:
   nss-pam-ldapd/configure.ac
   nss-pam-ldapd/nslcd/nslcd.c
   nss-pam-ldapd/nss/Makefile.am

Modified: nss-pam-ldapd/configure.ac
==============================================================================
--- nss-pam-ldapd/configure.ac  Sat Jul  3 18:10:45 2010        (r1160)
+++ nss-pam-ldapd/configure.ac  Wed Jul  7 22:21:28 2010        (r1161)
@@ -198,6 +198,15 @@
 AC_DEFINE_UNQUOTED(NSLCD_SOCKET,"$NSLCD_SOCKET",[The location of the socket 
used for communicating.])
 AC_SUBST(NSLCD_SOCKET)
 
+# the SONAME to use for the NSS module
+AC_ARG_WITH(nss-ldap-soname,
+            AS_HELP_STRING([--with-nss-ldap-soname=SONAME],
+                           [name of NSS module @<:@libnss_ldap.so.2@:>@]),
+            [ NSS_LDAP_SONAME="$with_nslcd_socket" ],
+            [ NSS_LDAP_SONAME="libnss_ldap.so.2" ])
+AC_DEFINE_UNQUOTED(NSS_LDAP_SONAME,"$NSS_LDAP_SONAME",[The SONAME of the NSS 
library module.])
+AC_SUBST(NSS_LDAP_SONAME)
+
 # checks for availability of header files
 AC_CHECK_HEADERS([ctype.h strings.h pthread.h fcntl.h limits.h])
 AC_CHECK_HEADERS([nss.h grp.h shadow.h aliases.h netdb.h rpc/rpcent.h])

Modified: nss-pam-ldapd/nslcd/nslcd.c
==============================================================================
--- nss-pam-ldapd/nslcd/nslcd.c Sat Jul  3 18:10:45 2010        (r1160)
+++ nss-pam-ldapd/nslcd/nslcd.c Wed Jul  7 22:21:28 2010        (r1161)
@@ -574,7 +574,7 @@
   char *error;
   int *enable_flag;
   /* try to load the NSS module */
-  handle=dlopen("libnss_ldap.so.2",RTLD_LAZY|RTLD_NODELETE);
+  handle=dlopen(NSS_LDAP_SONAME,RTLD_LAZY|RTLD_NODELETE);
   if (handle==NULL)
   {
     log_log(LOG_WARNING,"Warning: LDAP NSS module not loaded: %s",dlerror());

Modified: nss-pam-ldapd/nss/Makefile.am
==============================================================================
--- nss-pam-ldapd/nss/Makefile.am       Sat Jul  3 18:10:45 2010        (r1160)
+++ nss-pam-ldapd/nss/Makefile.am       Wed Jul  7 22:21:28 2010        (r1161)
@@ -24,17 +24,13 @@
 AM_CPPFLAGS=-I$(top_srcdir)
 AM_CFLAGS = -fPIC
 
-# determin version numbers to use in installed files
-NSS_VERS = 2
-NSS_LDAP_NSS_VERSIONED = libnss_ldap.so.$(NSS_VERS)
-
 nss_ldap_so_SOURCES = common.c common.h prototypes.h \
                       ../nslcd.h ../common/nslcd-prot.h \
                       ../compat/attrs.h \
                       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_LDFLAGS = -shared -Wl,-soname,$(NSS_LDAP_NSS_VERSIONED)
+nss_ldap_so_LDFLAGS = -shared -Wl,-soname,$(NSS_LDAP_SONAME)
 if HAVE_VERSION_SCRIPT_FLAG
 nss_ldap_so_LDFLAGS += $(VERSION_SCRIPT_FLAG)\$(srcdir)/nss_ldap.map
 endif
@@ -47,6 +43,6 @@
 
 # install libnss_ldap.so.2
 install-nss_ldap_so: nss_ldap.so
-       $(INSTALL_PROGRAM) -D nss_ldap.so 
$(DESTDIR)$(libdir)/$(NSS_LDAP_NSS_VERSIONED)
+       $(INSTALL_PROGRAM) -D nss_ldap.so $(DESTDIR)$(libdir)/$(NSS_LDAP_SONAME)
 uninstall-nss_ldap_so:
-       -rm -f $(DESTDIR)$(libdir)/$(NSS_LDAP_NSS_VERSIONED)
+       -rm -f $(DESTDIR)$(libdir)/$(NSS_LDAP_SONAME)
--
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits