Load plugins with RTLD_GLOBAL instead of RTLD_LOCAL. This fixes
problems with pam modules not having access to symbols provided by libpam on some platforms. Affects FreeBSD and SLES 10 at least.
This commit is contained in:
@@ -54,8 +54,8 @@
|
|||||||
|
|
||||||
#include "sudoers.h"
|
#include "sudoers.h"
|
||||||
|
|
||||||
#ifndef RTLD_LOCAL
|
#ifndef RTLD_GLOBAL
|
||||||
# define RTLD_LOCAL 0
|
# define RTLD_GLOBAL 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void *group_handle;
|
static void *group_handle;
|
||||||
@@ -109,7 +109,7 @@ group_plugin_load(char *plugin_info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Open plugin and map in symbol. */
|
/* Open plugin and map in symbol. */
|
||||||
group_handle = dlopen(path, RTLD_LAZY|RTLD_LOCAL);
|
group_handle = dlopen(path, RTLD_LAZY|RTLD_GLOBAL);
|
||||||
if (!group_handle) {
|
if (!group_handle) {
|
||||||
warningx(_("unable to dlopen %s: %s"), path, dlerror());
|
warningx(_("unable to dlopen %s: %s"), path, dlerror());
|
||||||
goto done;
|
goto done;
|
||||||
|
@@ -48,8 +48,8 @@
|
|||||||
#include "sudo_plugin.h"
|
#include "sudo_plugin.h"
|
||||||
#include "sudo_plugin_int.h"
|
#include "sudo_plugin_int.h"
|
||||||
|
|
||||||
#ifndef RTLD_LOCAL
|
#ifndef RTLD_GLOBAL
|
||||||
# define RTLD_LOCAL 0
|
# define RTLD_GLOBAL 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *noexec_path = _PATH_SUDO_NOEXEC;
|
const char *noexec_path = _PATH_SUDO_NOEXEC;
|
||||||
@@ -176,7 +176,7 @@ sudo_load_plugins(const char *conf_file,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Open plugin and map in symbol */
|
/* Open plugin and map in symbol */
|
||||||
handle = dlopen(path, RTLD_LAZY|RTLD_LOCAL);
|
handle = dlopen(path, RTLD_LAZY|RTLD_GLOBAL);
|
||||||
if (!handle) {
|
if (!handle) {
|
||||||
warningx(_("unable to dlopen %s: %s"), path, dlerror());
|
warningx(_("unable to dlopen %s: %s"), path, dlerror());
|
||||||
goto done;
|
goto done;
|
||||||
|
Reference in New Issue
Block a user