always load plugins with RTLD_LOCAL/RTLD_GROUP if available

This commit is contained in:
Luke Howard
2018-12-31 12:46:29 +11:00
committed by Nico Williams
parent 803efebca5
commit befe1b8f90
9 changed files with 39 additions and 61 deletions

View File

@@ -37,9 +37,6 @@
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif
static int
min_length_passwd_quality (krb5_context context,
@@ -250,10 +247,6 @@ static int num_verifiers;
* setup the password quality hook
*/
#ifndef RTLD_NOW
#define RTLD_NOW 0
#endif
void
kadm5_setup_passwd_quality_check(krb5_context context,
const char *check_library,
@@ -286,7 +279,7 @@ kadm5_setup_passwd_quality_check(krb5_context context,
if(check_library == NULL)
return;
handle = dlopen(check_library, RTLD_NOW);
handle = dlopen(check_library, RTLD_NOW | RTLD_LOCAL | RTLD_GROUP);
if(handle == NULL) {
krb5_warnx(context, "failed to open `%s'", check_library);
return;
@@ -326,7 +319,7 @@ add_verifier(krb5_context context, const char *check_library)
void *handle;
int i;
handle = dlopen(check_library, RTLD_NOW);
handle = dlopen(check_library, RTLD_NOW | RTLD_LOCAL | RTLD_GROUP);
if(handle == NULL) {
krb5_warnx(context, "failed to open `%s'", check_library);
return ENOENT;