summaryrefslogtreecommitdiff
path: root/source3/lib/ldb/common/ldb_modules.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-11-15 17:34:20 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:50 -0500
commit866a3b6e40952193d5bcd812ec7079cf7434e600 (patch)
treefe66f644d76f735fb642ec80df4c368d573b4745 /source3/lib/ldb/common/ldb_modules.c
parent06715191dd4347104efb3f8929290edc1f969752 (diff)
downloadsamba-866a3b6e40952193d5bcd812ec7079cf7434e600.tar.gz
samba-866a3b6e40952193d5bcd812ec7079cf7434e600.tar.bz2
samba-866a3b6e40952193d5bcd812ec7079cf7434e600.zip
r19725: sync samba3's ldb with samba4
metze (This used to be commit 207643e9c9c75546f38a09f12ea0b574b08086c5)
Diffstat (limited to 'source3/lib/ldb/common/ldb_modules.c')
-rw-r--r--source3/lib/ldb/common/ldb_modules.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/source3/lib/ldb/common/ldb_modules.c b/source3/lib/ldb/common/ldb_modules.c
index 8bcafa36a8..a6997b324a 100644
--- a/source3/lib/ldb/common/ldb_modules.c
+++ b/source3/lib/ldb/common/ldb_modules.c
@@ -159,6 +159,7 @@ static const struct ldb_module_ops *ldb_find_module_ops(const char *name)
ldb_objectclass_init, \
ldb_paged_results_init, \
ldb_sort_init, \
+ ldb_asq_init, \
NULL \
}
#endif
@@ -205,17 +206,26 @@ int ldb_try_load_dso(struct ldb_context *ldb, const char *name)
char *path;
void *handle;
int (*init_fn) (void);
+ char *modulesdir;
#ifdef HAVE_DLOPEN
+ if (getenv("LD_LDB_MODULE_PATH") != NULL) {
+ modulesdir = talloc_strdup(ldb, getenv("LD_LDB_MODULE_PATH"));
+ } else {
#ifdef _SAMBA_BUILD_
- path = talloc_asprintf(ldb, "%s/ldb/%s.%s", dyn_MODULESDIR, name, dyn_SHLIBEXT);
+ modulesdir = talloc_asprintf(ldb, "%s/ldb", dyn_MODULESDIR);
#else
- path = talloc_asprintf(ldb, "%s/%s.%s", MODULESDIR, name, SHLIBEXT);
+ modulesdir = talloc_strdup(ldb, MODULESDIR);
#endif
+ }
+
+ path = talloc_asprintf(ldb, "%s/%s.%s", modulesdir, name, SHLIBEXT);
+
+ talloc_free(modulesdir);
ldb_debug(ldb, LDB_DEBUG_TRACE, "trying to load %s from %s\n", name, path);
- handle = dlopen(path, 0);
+ handle = dlopen(path, RTLD_NOW);
if (handle == NULL) {
ldb_debug(ldb, LDB_DEBUG_WARNING, "unable to load %s from %s: %s\n", name, path, dlerror());
return -1;