summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common/ldb.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-03-20 21:44:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:58:58 -0500
commitbb1909e15e7a9f3cd79da2ce8b8ef90f1a557376 (patch)
tree4de860f4c78c2c5b590468b27274e8e563b18d00 /source4/lib/ldb/common/ldb.c
parentd0c7651a7d4a2fb3bd2531f4c37cdfd8c7af0fed (diff)
downloadsamba-bb1909e15e7a9f3cd79da2ce8b8ef90f1a557376.tar.gz
samba-bb1909e15e7a9f3cd79da2ce8b8ef90f1a557376.tar.bz2
samba-bb1909e15e7a9f3cd79da2ce8b8ef90f1a557376.zip
r14592: Add support for loading shared modules to LDB.
(This used to be commit f10fae23f0685b2d9c6174596e1c66d799f02c52)
Diffstat (limited to 'source4/lib/ldb/common/ldb.c')
-rw-r--r--source4/lib/ldb/common/ldb.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c
index 9acf74535b..0d424ad601 100644
--- a/source4/lib/ldb/common/ldb.c
+++ b/source4/lib/ldb/common/ldb.c
@@ -102,15 +102,26 @@ static ldb_connect_fn ldb_find_backend(const char *url)
int ldb_connect(struct ldb_context *ldb, const char *url, unsigned int flags, const char *options[])
{
int ret;
+ char *backend;
ldb_connect_fn fn;
if (strchr(url, ':') != NULL) {
- fn = ldb_find_backend(url);
+ backend = talloc_strndup(ldb, url, strchr(url, ':')-url);
} else {
/* Default to tdb */
- fn = ldb_find_backend("tdb:");
+ backend = talloc_strdup(ldb, "tdb");
}
+ fn = ldb_find_backend(backend);
+
+ if (fn == NULL) {
+ if (ldb_try_load_dso(ldb, backend) == 0) {
+ fn = ldb_find_backend(backend);
+ }
+ }
+
+ talloc_free(backend);
+
if (fn == NULL) {
ldb_debug(ldb, LDB_DEBUG_FATAL, "Unable to find backend for '%s'\n", url);
return LDB_ERR_OTHER;