From 9b0f8a8e5ff578c0eb231fea80943f2a72dd7286 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 1 Nov 2010 22:48:16 +1100 Subject: s4-ldb: use ldb_set_modules_dir() to load additional ldb modules this allows ldb_wrap to enable s4 modules in a standalone ldb install without any additional installation Autobuild-User: Andrew Tridgell Autobuild-Date: Mon Nov 1 13:47:33 UTC 2010 on sn-devel-104 --- source4/lib/ldb/common/ldb_modules.c | 18 ++++++++++++------ source4/lib/ldb/include/ldb_private.h | 2 -- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'source4/lib/ldb') diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c index 5f01082e1d..1eeede23f7 100644 --- a/source4/lib/ldb/common/ldb_modules.c +++ b/source4/lib/ldb/common/ldb_modules.c @@ -35,12 +35,6 @@ #include "dlinklist.h" #include "system/dir.h" -void ldb_set_modules_dir(struct ldb_context *ldb, const char *path) -{ - talloc_free(ldb->modules_dir); - ldb->modules_dir = talloc_strdup(ldb, path); -} - static char *ldb_modules_strdup_no_spaces(TALLOC_CTX *mem_ctx, const char *string) { size_t i, len; @@ -978,6 +972,18 @@ static int ldb_modules_load_dir(const char *modules_dir, const char *version) return LDB_SUCCESS; } +/* + load any additional modules from the given directory +*/ +void ldb_set_modules_dir(struct ldb_context *ldb, const char *path) +{ + int ret = ldb_modules_load_dir(path, LDB_VERSION); + if (ret != LDB_SUCCESS) { + ldb_asprintf_errstring(ldb, "Failed to load modules from: %s\n", path); + } +} + + /* load all modules static (builtin) modules */ diff --git a/source4/lib/ldb/include/ldb_private.h b/source4/lib/ldb/include/ldb_private.h index 04b6897e69..57d003b840 100644 --- a/source4/lib/ldb/include/ldb_private.h +++ b/source4/lib/ldb/include/ldb_private.h @@ -118,8 +118,6 @@ struct ldb_context { unsigned int create_perms; - char *modules_dir; - struct tevent_context *ev_ctx; bool prepare_commit_done; -- cgit