From ca7baa3c9fc4814b7033f68a88ddac8072d62e2a Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 6 Jun 2005 15:19:49 +0000 Subject: r7343: handle url like ldb_tdb does (This used to be commit d36fde5c0cfe20d03dd99e2ffffdd13acf9f76f3) --- source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'source4') diff --git a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c index 602bd05fa2..9ed137c4f5 100644 --- a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c +++ b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c @@ -903,11 +903,16 @@ lsqlite3_initialize(struct lsqlite3_private *lsqlite3, ; /* Skip protocol indicator of url */ - if ((p = strchr(url, ':')) == NULL) { - return SQLITE_MISUSE; - } else { - ++p; - } + if (strchr(url, ':')) { + if (strncmp(url, "sqlite://", 9) != 0) { + errno = EINVAL; + return SQLITE_MISUSE; + } + p = url + 9; + } else { + p = url; + } + /* * See if we'll be creating a new database, or opening an existing one -- cgit