pull up r18192 from trunk
authorTom Yu <tlyu@mit.edu>
Sun, 25 Jun 2006 23:17:02 +0000 (23:17 +0000)
committerTom Yu <tlyu@mit.edu>
Sun, 25 Jun 2006 23:17:02 +0000 (23:17 +0000)
 r18192@cathode-dark-space:  tlyu | 2006-06-21 23:00:53 -0400
 ticket: 3909
 tags: pullup

  * src/util/support/plugins.c (krb5int_open_plugin): Use RTLD_LOCAL
  instead of RTLD_GLOBAL.  Use RTLD_GROUP if available.

ticket: 3909
version_fixed: 1.5

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-5@18217 dc483132-0cff-0310-8789-dd5450dbe970

src/util/support/plugins.c

index 9d025942ecd9907737259ac8d7623219a058ac31..d0752e3229244b666aec78ea675be3320d5ef26e 100644 (file)
@@ -95,9 +95,14 @@ krb5int_open_plugin (const char *filepath, struct plugin_file_handle **h, struct
 #if USE_DLOPEN
     if (!err && (statbuf.st_mode & S_IFMT) == S_IFREG) {
         void *handle = NULL;
+#ifdef RTLD_GROUP
+#define PLUGIN_DLOPEN_FLAGS (RTLD_NOW | RTLD_LOCAL | RTLD_GROUP)
+#else
+#define PLUGIN_DLOPEN_FLAGS (RTLD_NOW | RTLD_LOCAL)
+#endif
 
         if (!err) {
-            handle = dlopen(filepath, RTLD_NOW | RTLD_GLOBAL);
+            handle = dlopen(filepath, PLUGIN_DLOPEN_FLAGS);
             if (handle == NULL) {
                 const char *e = dlerror();
                 Tprintf ("dlopen(%s): %s\n", filepath, e);