From 71bc5acead0e16473273eb8741373e865b6d2c44 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 20 Feb 2008 01:37:53 +0100 Subject: Allow ldb backends without init function, use init function-less ldb modules. (This used to be commit 141ee91272fb4dafca0149f679e17721b6a3011e) --- source4/lib/ldb/common/ldb.c | 9 +++++++++ source4/lib/ldb/common/ldb_modules.c | 9 +++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'source4/lib/ldb/common') diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c index 87f791cb38..ffda705a0b 100644 --- a/source4/lib/ldb/common/ldb.c +++ b/source4/lib/ldb/common/ldb.c @@ -135,6 +135,15 @@ int ldb_connect_backend(struct ldb_context *ldb, const char *url, const char *op } } + if (fn == NULL) { + char *symbol_name = talloc_asprintf(ldb, "ldb_%s_connect", backend); + if (symbol_name == NULL) { + return LDB_ERR_OPERATIONS_ERROR; + } + fn = ldb_dso_load_symbol(ldb, backend, symbol_name); + talloc_free(symbol_name); + } + talloc_free(backend); if (fn == NULL) { diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c index 18070bdb86..2dae40ddb0 100644 --- a/source4/lib/ldb/common/ldb_modules.c +++ b/source4/lib/ldb/common/ldb_modules.c @@ -257,8 +257,13 @@ int ldb_load_modules_list(struct ldb_context *ldb, const char **module_list, str } if (ops == NULL) { - ops = ldb_dso_load_symbol(ldb, module_list[i], - "ldb_module_ops"); + char *symbol_name = talloc_asprintf(ldb, "ldb_%s_module_ops", + module_list[i]); + if (symbol_name == NULL) { + return LDB_ERR_OPERATIONS_ERROR; + } + ops = ldb_dso_load_symbol(ldb, module_list[i], symbol_name); + talloc_free(symbol_name); } if (ops == NULL) { -- cgit