summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2010-06-16 20:22:29 +0000
committerArthur de Jong <arthur@arthurdejong.org>2010-06-16 20:22:29 +0000
commit082e1a8cd25b63d9b2a6c91151c0f486ee579b8f (patch)
treeec21493bb957aefcfce43b306992452336414ed7
parent7859f07ecf0d5797d2077eeec3dd0f201aa83010 (diff)
use RTLD_NODELETE during dlopen() instead of not using dlclose()
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1144 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r--nslcd/nslcd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/nslcd/nslcd.c b/nslcd/nslcd.c
index c6fcfaa..047d168 100644
--- a/nslcd/nslcd.c
+++ b/nslcd/nslcd.c
@@ -574,7 +574,7 @@ static void disable_nss_ldap(void)
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 @@ static void disable_nss_ldap(void)
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... */