always load plugins with RTLD_LOCAL/RTLD_GROUP if available
This commit is contained in:

committed by
Nico Williams

parent
803efebca5
commit
befe1b8f90
@@ -314,14 +314,6 @@ _gss_load_mech(void)
|
|||||||
if (found)
|
if (found)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
#ifndef RTLD_LOCAL
|
|
||||||
#define RTLD_LOCAL 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef RTLD_GROUP
|
|
||||||
#define RTLD_GROUP 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
so = dlopen(lib, RTLD_LAZY | RTLD_LOCAL | RTLD_GROUP);
|
so = dlopen(lib, RTLD_LAZY | RTLD_LOCAL | RTLD_GROUP);
|
||||||
if (so == NULL) {
|
if (so == NULL) {
|
||||||
/* fprintf(stderr, "dlopen: %s\n", dlerror()); */
|
/* fprintf(stderr, "dlopen: %s\n", dlerror()); */
|
||||||
|
@@ -36,13 +36,6 @@
|
|||||||
|
|
||||||
#include <engine.h>
|
#include <engine.h>
|
||||||
|
|
||||||
#ifdef HAVE_DLFCN_H
|
|
||||||
#include <dlfcn.h>
|
|
||||||
#ifndef RTLD_NOW
|
|
||||||
#define RTLD_NOW 0
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct hc_engine {
|
struct hc_engine {
|
||||||
int references;
|
int references;
|
||||||
char *name;
|
char *name;
|
||||||
@@ -313,7 +306,7 @@ ENGINE_by_dso(const char *path, const char *id)
|
|||||||
if (engine == NULL)
|
if (engine == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
handle = dlopen(path, RTLD_NOW);
|
handle = dlopen(path, RTLD_NOW | RTLD_LOCAL | RTLD_GROUP);
|
||||||
if (handle == NULL) {
|
if (handle == NULL) {
|
||||||
/* printf("error: %s\n", dlerror()); */
|
/* printf("error: %s\n", dlerror()); */
|
||||||
free(engine);
|
free(engine);
|
||||||
|
@@ -33,21 +33,8 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <roken.h>
|
#include <roken.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#ifdef HAVE_DLFCN_H
|
|
||||||
#include <dlfcn.h>
|
#ifndef HAVE_DLFCN_H
|
||||||
#ifndef RTLD_LAZY
|
|
||||||
#define RTLD_LAZY 0
|
|
||||||
#endif
|
|
||||||
#ifndef RTLD_LOCAL
|
|
||||||
#define RTLD_LOCAL 0
|
|
||||||
#endif
|
|
||||||
#ifndef RTLD_GROUP
|
|
||||||
#define RTLD_GROUP 0
|
|
||||||
#endif
|
|
||||||
#ifndef RTLD_NODELETE
|
|
||||||
#define RTLD_NODELETE 0
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#error PKCS11 support requires dlfcn.h
|
#error PKCS11 support requires dlfcn.h
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -32,9 +32,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "hx_locl.h"
|
#include "hx_locl.h"
|
||||||
#ifdef HAVE_DLFCN_H
|
|
||||||
#include <dlfcn.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_DLOPEN
|
#ifdef HAVE_DLOPEN
|
||||||
|
|
||||||
@@ -849,7 +846,7 @@ p11_init(hx509_context context,
|
|||||||
str = strnext;
|
str = strnext;
|
||||||
}
|
}
|
||||||
|
|
||||||
p->dl_handle = dlopen(list, RTLD_NOW);
|
p->dl_handle = dlopen(list, RTLD_NOW | RTLD_LOCAL | RTLD_GROUP);
|
||||||
if (p->dl_handle == NULL) {
|
if (p->dl_handle == NULL) {
|
||||||
ret = HX509_PKCS11_LOAD;
|
ret = HX509_PKCS11_LOAD;
|
||||||
hx509_set_error_string(context, 0, ret,
|
hx509_set_error_string(context, 0, ret,
|
||||||
|
@@ -37,9 +37,6 @@
|
|||||||
#ifdef HAVE_SYS_WAIT_H
|
#ifdef HAVE_SYS_WAIT_H
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_DLFCN_H
|
|
||||||
#include <dlfcn.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
min_length_passwd_quality (krb5_context context,
|
min_length_passwd_quality (krb5_context context,
|
||||||
@@ -250,10 +247,6 @@ static int num_verifiers;
|
|||||||
* setup the password quality hook
|
* setup the password quality hook
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef RTLD_NOW
|
|
||||||
#define RTLD_NOW 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
void
|
||||||
kadm5_setup_passwd_quality_check(krb5_context context,
|
kadm5_setup_passwd_quality_check(krb5_context context,
|
||||||
const char *check_library,
|
const char *check_library,
|
||||||
@@ -286,7 +279,7 @@ kadm5_setup_passwd_quality_check(krb5_context context,
|
|||||||
|
|
||||||
if(check_library == NULL)
|
if(check_library == NULL)
|
||||||
return;
|
return;
|
||||||
handle = dlopen(check_library, RTLD_NOW);
|
handle = dlopen(check_library, RTLD_NOW | RTLD_LOCAL | RTLD_GROUP);
|
||||||
if(handle == NULL) {
|
if(handle == NULL) {
|
||||||
krb5_warnx(context, "failed to open `%s'", check_library);
|
krb5_warnx(context, "failed to open `%s'", check_library);
|
||||||
return;
|
return;
|
||||||
@@ -326,7 +319,7 @@ add_verifier(krb5_context context, const char *check_library)
|
|||||||
void *handle;
|
void *handle;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
handle = dlopen(check_library, RTLD_NOW);
|
handle = dlopen(check_library, RTLD_NOW | RTLD_LOCAL | RTLD_GROUP);
|
||||||
if(handle == NULL) {
|
if(handle == NULL) {
|
||||||
krb5_warnx(context, "failed to open `%s'", check_library);
|
krb5_warnx(context, "failed to open `%s'", check_library);
|
||||||
return ENOENT;
|
return ENOENT;
|
||||||
|
@@ -35,9 +35,6 @@
|
|||||||
|
|
||||||
#include "krb5_locl.h"
|
#include "krb5_locl.h"
|
||||||
#include <krb5_ccapi.h>
|
#include <krb5_ccapi.h>
|
||||||
#ifdef HAVE_DLFCN_H
|
|
||||||
#include <dlfcn.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef KCM_IS_API_CACHE
|
#ifndef KCM_IS_API_CACHE
|
||||||
|
|
||||||
@@ -115,23 +112,16 @@ init_ccapi(krb5_context context)
|
|||||||
|
|
||||||
#ifdef HAVE_DLOPEN
|
#ifdef HAVE_DLOPEN
|
||||||
|
|
||||||
#ifndef RTLD_LAZY
|
|
||||||
#define RTLD_LAZY 0
|
|
||||||
#endif
|
|
||||||
#ifndef RTLD_LOCAL
|
|
||||||
#define RTLD_LOCAL 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef KRB5_USE_PATH_TOKENS
|
#ifdef KRB5_USE_PATH_TOKENS
|
||||||
{
|
{
|
||||||
char * explib = NULL;
|
char * explib = NULL;
|
||||||
if (_krb5_expand_path_tokens(context, lib, 0, &explib) == 0) {
|
if (_krb5_expand_path_tokens(context, lib, 0, &explib) == 0) {
|
||||||
cc_handle = dlopen(explib, RTLD_LAZY|RTLD_LOCAL);
|
cc_handle = dlopen(explib, RTLD_LAZY|RTLD_LOCAL|RTLD_GROUP);
|
||||||
free(explib);
|
free(explib);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
cc_handle = dlopen(lib, RTLD_LAZY|RTLD_LOCAL);
|
cc_handle = dlopen(lib, RTLD_LAZY|RTLD_LOCAL|RTLD_GROUP);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (cc_handle == NULL) {
|
if (cc_handle == NULL) {
|
||||||
|
@@ -35,11 +35,6 @@
|
|||||||
|
|
||||||
#include "krb5_locl.h"
|
#include "krb5_locl.h"
|
||||||
|
|
||||||
#ifdef HAVE_DLFCN_H
|
|
||||||
#include <dlfcn.h>
|
|
||||||
#endif
|
|
||||||
#include <dirent.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Definitions:
|
* Definitions:
|
||||||
*
|
*
|
||||||
|
@@ -292,6 +292,33 @@
|
|||||||
#define __attribute__(x)
|
#define __attribute__(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* for dlopen(3)
|
||||||
|
*/
|
||||||
|
#ifndef RTLD_LAZY
|
||||||
|
#define RTLD_LAZY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef RTLD_NOW
|
||||||
|
#define RTLD_NOW 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef RTLD_GLOBAL
|
||||||
|
#define RTLD_GLOBAL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef RTLD_LOCAL
|
||||||
|
#define RTLD_LOCAL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef RTLD_GROUP
|
||||||
|
#define RTLD_GROUP 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef RTLD_NODELETE
|
||||||
|
#define RTLD_NODELETE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
ROKEN_CPP_START
|
ROKEN_CPP_START
|
||||||
|
|
||||||
#ifndef IRIX4 /* fix for compiler bug */
|
#ifndef IRIX4 /* fix for compiler bug */
|
||||||
|
@@ -296,6 +296,10 @@ struct sockaddr_dl;
|
|||||||
#include <paths.h>
|
#include <paths.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_DLFCN_H
|
||||||
|
#include <dlfcn.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_DIRENT_H
|
#ifdef HAVE_DIRENT_H
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user