r7343: handle url like ldb_tdb does
authorSimo Sorce <idra@samba.org>
Mon, 6 Jun 2005 15:19:49 +0000 (15:19 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:17:45 +0000 (13:17 -0500)
(This used to be commit d36fde5c0cfe20d03dd99e2ffffdd13acf9f76f3)

source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c

index 602bd05fa2c6d298eec816d20f7b5ea08a01855c..9ed137c4f540fac8261f0c50dc644b53ce79a9b9 100644 (file)
@@ -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