lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1144 - nss-pam-ldapd/nslcd

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

nss-pam-ldapd commit: r1144 - nss-pam-ldapd/nslcd



Author: arthur
Date: Wed Jun 16 22:22:29 2010
New Revision: 1144
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?view=rev&revision=1144

Log:
use RTLD_NODELETE during dlopen() instead of not using dlclose()

Modified:
   nss-pam-ldapd/nslcd/nslcd.c

Modified: nss-pam-ldapd/nslcd/nslcd.c
==============================================================================
--- nss-pam-ldapd/nslcd/nslcd.c Tue Jun 15 21:53:06 2010        (r1143)
+++ nss-pam-ldapd/nslcd/nslcd.c Wed Jun 16 22:22:29 2010        (r1144)
@@ -574,7 +574,7 @@
   char *error;
   int *enable_flag;
   /* try to load the NSS module */
-  handle=dlopen("libnss_ldap.so.2",RTLD_LAZY);
+  handle=dlopen("libnss_ldap.so.2",RTLD_LAZY|RTLD_NODELETE);
   if (handle==NULL)
   {
     log_log(LOG_WARNING,"Warning: LDAP NSS module not loaded: %s",dlerror());
@@ -593,12 +593,13 @@
     if (__nss_configure_lookup("hosts","files dns"))
       log_log(LOG_ERR,"unable to override hosts lookup method: 
%s",strerror(errno));
 #endif /* HAVE___NSS_CONFIGURE_LOOKUP */
+    dlclose(handle);
     return;
   }
   /* disable nss_ldap */
   *enable_flag=0;
-  /* we don't do dlclose() because we want the symbol change to be
-     persistent */
+  /* close the handle */
+  dlclose(handle);
 }
 
 /* the main program... */
--
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits