openldap/openldap-switch-to-lt_dlopenadvise-to-get-RTLD_GLOBAL-set.patch
Simon Pichugin 004e302f0d Update to new major release OpenLDAP 2.6.1
- rediff all patches and remove patches now upstream
- use upstream source location for check password module
  and rediff patch due to this
- add patch to fix build issue in 2.5.4 (from upstream)
- clean and sort buildreqs
- remove various refs to bdb
- remove now default -DLDAP_USE_NON_BLOCKING_TLS
- add new modules and enable load balancer as module
- disable wiredtired backend due to missing build deps
- don't remove files that don't exist
- let check-config work on *.mdb over legacy files
- remove refs to old-style config
- new soname names
- remove libldap_r link as the library was merged with libldap
- refactor openldap-compat package to support the transition from 2.4
- add UPGRADE_INSTRUCTIONS for openldap-server upgrade

The original patch was submitted by Fedora user - terjeros
https://src.fedoraproject.org/rpms/openldap/pull-request/6

Resolves: #1955293
2022-01-31 14:59:38 -08:00

44 lines
1.3 KiB
Diff

From: Jan-Marek Glogowski <jan-marek.glogowski@muenchen.de>
Date: Tue, 18 May 2010 17:47:05 +0200
Subject: [PATCH] Switch to lt_dlopenadvise() to get RTLD_GLOBAL set.
Proof of concept for fixing http://bugs.debian.org/327585
(patch ported from freeradius bug http://bugs.debian.org/416266)
Resolves: #960048
diff --git a/servers/slapd/module.c b/servers/slapd/module.c
index e616f1d..52bacff 100644
--- a/servers/slapd/module.c
+++ b/servers/slapd/module.c
@@ -117,6 +117,20 @@ int module_unload( const char *file_name )
return -1; /* not found */
}
+static lt_dlhandle slapd_lt_dlopenext_global( const char *filename )
+{
+ lt_dlhandle handle = 0;
+ lt_dladvise advise;
+
+ if (!lt_dladvise_init (&advise) && !lt_dladvise_ext (&advise)
+ && !lt_dladvise_global (&advise))
+ handle = lt_dlopenadvise (filename, advise);
+
+ lt_dladvise_destroy (&advise);
+
+ return handle;
+}
+
int module_load(const char* file_name, int argc, char *argv[])
{
module_loaded_t *module;
@@ -179,7 +193,7 @@ int module_load(const char* file_name, int argc, char *argv[])
* to calling Debug. This is because Debug is a macro that expands
* into multiple function calls.
*/
- if ((module->lib = lt_dlopenext(file)) == NULL) {
+ if ((module->lib = slapd_lt_dlopenext_global(file)) == NULL) {
error = lt_dlerror();
#ifdef HAVE_EBCDIC
strcpy( ebuf, error );