1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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 03df31cef0)
This commit is contained in:
Andrew Tridgell 2004-05-03 09:34:18 +00:00 committed by Gerald (Jerry) Carter
parent 1cc8db0132
commit b96695ca23
2 changed files with 10 additions and 6 deletions

View File

@ -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);
}

View File

@ -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) {