summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-11-01 22:48:16 +1100
committerAndrew Tridgell <tridge@samba.org>2010-11-01 13:47:33 +0000
commit9b0f8a8e5ff578c0eb231fea80943f2a72dd7286 (patch)
treeba8ccd855a4e6372d58a9da69e2e9bf7b4c1b476 /source4/lib/ldb/common
parent91030477825112d50c6f4e72f9ece2a51a79230a (diff)
downloadsamba-9b0f8a8e5ff578c0eb231fea80943f2a72dd7286.tar.gz
samba-9b0f8a8e5ff578c0eb231fea80943f2a72dd7286.tar.bz2
samba-9b0f8a8e5ff578c0eb231fea80943f2a72dd7286.zip
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 <tridge@samba.org> Autobuild-Date: Mon Nov 1 13:47:33 UTC 2010 on sn-devel-104
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r--source4/lib/ldb/common/ldb_modules.c18
1 files changed, 12 insertions, 6 deletions
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
*/