summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-10-28 22:32:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:45:29 -0500
commit773f0ecf5ab07975b17f10448fb06af06905e8b7 (patch)
tree929e6146f14cb737e5862f818dd52af6ed0642dc /source4/lib
parenta4e7bf3a89a986f0055bb8b6c6890449ca405f39 (diff)
downloadsamba-773f0ecf5ab07975b17f10448fb06af06905e8b7.tar.gz
samba-773f0ecf5ab07975b17f10448fb06af06905e8b7.tar.bz2
samba-773f0ecf5ab07975b17f10448fb06af06905e8b7.zip
r11385: Fix issues in module.c. Calling function should pass in path
to directory rather then subsystem name now. (This used to be commit 2a868ab3b57f64a27416c7a24c8d1ae112fc0c53)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/basic.mk6
-rw-r--r--source4/lib/module.c16
2 files changed, 6 insertions, 16 deletions
diff --git a/source4/lib/basic.mk b/source4/lib/basic.mk
index 06470a1079..383892eb9c 100644
--- a/source4/lib/basic.mk
+++ b/source4/lib/basic.mk
@@ -59,9 +59,6 @@ INIT_OBJ_FILES = \
OBJ_FILES = \
gencache.o \
-[SUBSYSTEM::MODULE]
-OBJ_FILES = module.o
-
##############################
# Start SUBSYSTEM LIBBASIC
[SUBSYSTEM::LIBBASIC]
@@ -89,7 +86,8 @@ ADD_OBJ_FILES = \
mutex.o \
idtree.o \
db_wrap.o \
- gendb.o
+ gendb.o \
+ module.o
REQUIRED_SUBSYSTEMS = \
LIBLDB CHARSET LIBREPLACE LIBNETIF LIBCRYPTO EXT_LIB_DL LIBTALLOC \
SOCKET_WRAPPER CONFIG
diff --git a/source4/lib/module.c b/source4/lib/module.c
index b46d2b317c..2eb9f6e61e 100644
--- a/source4/lib/module.c
+++ b/source4/lib/module.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "dynconfig.h"
#include "system/dir.h"
static BOOL load_module(TALLOC_CTX *mem_ctx, const char *dir, const char *name)
@@ -31,7 +30,7 @@ static BOOL load_module(TALLOC_CTX *mem_ctx, const char *dir, const char *name)
path = talloc_asprintf(mem_ctx, "%s/%s", dir, name);
- handle = dlopen(path, 0);
+ handle = dlopen(path, RTLD_NOW);
if (handle == NULL) {
DEBUG(0, ("Unable to open %s: %s\n", path, dlerror()));
return False;
@@ -56,23 +55,16 @@ static BOOL load_module(TALLOC_CTX *mem_ctx, const char *dir, const char *name)
return ret;
}
-BOOL load_modules(const char *subsystem)
+BOOL load_modules(const char *path)
{
DIR *dir;
struct dirent *entry;
- char *dir_path;
BOOL ret;
TALLOC_CTX *mem_ctx;
mem_ctx = talloc_init(NULL);
- dir_path = talloc_asprintf(mem_ctx, "%s/%s", dyn_LIBDIR, subsystem);
- if (!dir_path) {
- talloc_free(mem_ctx);
- return False;
- }
-
- dir = opendir(subsystem);
+ dir = opendir(path);
if (dir == NULL) {
talloc_free(mem_ctx);
return False;
@@ -82,7 +74,7 @@ BOOL load_modules(const char *subsystem)
if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, ".."))
continue;
- ret &= load_module(mem_ctx, dir_path, entry->d_name);
+ ret &= load_module(mem_ctx, path, entry->d_name);
}
closedir(dir);