From b96695ca23f8d1d95ed2e038ea66e6a0580356c3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 3 May 2004 09:34:18 +0000 Subject: r454: allow a non-URL form of a filename to be used in ldb_connect(). This makes it a little easier to work with the ldb tools (This used to be commit 03df31cef025b2087531579437d6bae1ec36e82f) --- source4/lib/ldb/ldb_tdb/ldb_tdb.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'source4/lib/ldb/ldb_tdb') diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c index eb2decfe31..92b88e4fb5 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c +++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c @@ -607,13 +607,16 @@ struct ldb_context *ltdb_connect(const char *url, struct ldb_context *ldb; /* parse the url */ - if (strncmp(url, "tdb://", 6) != 0) { - errno = EINVAL; - return NULL; + if (strchr(url, ':')) { + if (strncmp(url, "tdb://", 6) != 0) { + errno = EINVAL; + return NULL; + } + path = url+6; + } else { + path = url; } - path = url+6; - tdb_flags = TDB_DEFAULT; if (flags & LDB_FLG_RDONLY) { -- cgit