summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2005-06-06 15:19:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:45 -0500
commitca7baa3c9fc4814b7033f68a88ddac8072d62e2a (patch)
tree76e9eba3c7ae07a90a4bd9eca19a250e3c42d0a1 /source4
parentf9716b51cd6503911a18fd50698dd891387d1f8e (diff)
downloadsamba-ca7baa3c9fc4814b7033f68a88ddac8072d62e2a.tar.gz
samba-ca7baa3c9fc4814b7033f68a88ddac8072d62e2a.tar.bz2
samba-ca7baa3c9fc4814b7033f68a88ddac8072d62e2a.zip
r7343: handle url like ldb_tdb does
(This used to be commit d36fde5c0cfe20d03dd99e2ffffdd13acf9f76f3)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c15
1 files changed, 10 insertions, 5 deletions
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