summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-05-03 09:34:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:51:43 -0500
commitb96695ca23f8d1d95ed2e038ea66e6a0580356c3 (patch)
treeef455173636e89c495b9826533a79055e0742ce7 /source4/lib
parent1cc8db013226fada2249e4e210a7b020e8e31564 (diff)
downloadsamba-b96695ca23f8d1d95ed2e038ea66e6a0580356c3.tar.gz
samba-b96695ca23f8d1d95ed2e038ea66e6a0580356c3.tar.bz2
samba-b96695ca23f8d1d95ed2e038ea66e6a0580356c3.zip
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)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/common/ldb.c3
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb.c13
2 files changed, 10 insertions, 6 deletions
diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c
index f61ddecdc7..ac77f306e9 100644
--- a/source4/lib/ldb/common/ldb.c
+++ b/source4/lib/ldb/common/ldb.c
@@ -48,7 +48,8 @@ struct ldb_context *ldb_connect(const char *url, unsigned int flags,
const char *options[])
{
- if (strncmp(url, "tdb:", 4) == 0) {
+ if (strncmp(url, "tdb:", 4) == 0 ||
+ strchr(url, ':') == NULL) {
return ltdb_connect(url, flags, options);
}
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) {