summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util/support/plugins.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/util/support/plugins.c b/src/util/support/plugins.c
index ce65e1bca1..96b9d948d7 100644
--- a/src/util/support/plugins.c
+++ b/src/util/support/plugins.c
@@ -258,12 +258,20 @@ krb5int_open_plugin (const char *filepath, struct plugin_file_handle **h, struct
#endif /* USE_CFBUNDLE */
#ifdef RTLD_GROUP
-#define PLUGIN_DLOPEN_FLAGS (RTLD_NOW | RTLD_LOCAL | RTLD_GROUP)
+# ifdef RTLD_NODELETE
+# define PLUGIN_DLOPEN_FLAGS (RTLD_NOW | RTLD_LOCAL | RTLD_GROUP | RTLD_NODELETE)
+# else
+# define PLUGIN_DLOPEN_FLAGS (RTLD_NOW | RTLD_LOCAL | RTLD_GROUP)
+# endif
#else
-#define PLUGIN_DLOPEN_FLAGS (RTLD_NOW | RTLD_LOCAL)
+# ifdef RTLD_NODELETE
+# define PLUGIN_DLOPEN_FLAGS (RTLD_NOW | RTLD_LOCAL | RTLD_NODELETE)
+# else
+# define PLUGIN_DLOPEN_FLAGS (RTLD_NOW | RTLD_LOCAL)
+# endif
#endif
if (!err) {
- handle = dlopen(filepath, PLUGIN_DLOPEN_FLAGS | RTLD_NODELETE);
+ handle = dlopen(filepath, PLUGIN_DLOPEN_FLAGS);
if (handle == NULL) {
const char *e = dlerror();
if (e == NULL)