/ Check-in [3adb6c1b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:If the SQLITE_ALLOW_URI_AUTHORITY compile-time option is set, then allow non-localhost authorities on URI filenames and pass them through as a UNC to the underlying VFS.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3adb6c1bfda897859dc9cf9ae7f1e6719855ee68
User & Date: drh 2013-08-07 23:15:52
Context
2013-08-08
14:38
If the SQLITE_EXTRA_INIT function is defined, make sure it is called only once by the effective sqlite3_initialize() call. check-in: e2b597ca user: drh tags: trunk
2013-08-07
23:15
If the SQLITE_ALLOW_URI_AUTHORITY compile-time option is set, then allow non-localhost authorities on URI filenames and pass them through as a UNC to the underlying VFS. check-in: 3adb6c1b user: drh tags: trunk
14:18
Add a guard #ifndef to test_intarray.h to prevent harm if it is #included more than once. Add a comment on the closing #endif of the guards on sqlite3.h and test_multiplex.h. check-in: 0ad83ceb user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

  2174   2174       ** method that there may be extra parameters following the file-name.  */
  2175   2175       flags |= SQLITE_OPEN_URI;
  2176   2176   
  2177   2177       for(iIn=0; iIn<nUri; iIn++) nByte += (zUri[iIn]=='&');
  2178   2178       zFile = sqlite3_malloc(nByte);
  2179   2179       if( !zFile ) return SQLITE_NOMEM;
  2180   2180   
         2181  +    iIn = 5;
         2182  +#ifndef SQLITE_ALLOW_URI_AUTHORITY
  2181   2183       /* Discard the scheme and authority segments of the URI. */
  2182   2184       if( zUri[5]=='/' && zUri[6]=='/' ){
  2183   2185         iIn = 7;
  2184   2186         while( zUri[iIn] && zUri[iIn]!='/' ) iIn++;
  2185         -
  2186   2187         if( iIn!=7 && (iIn!=16 || memcmp("localhost", &zUri[7], 9)) ){
  2187   2188           *pzErrMsg = sqlite3_mprintf("invalid uri authority: %.*s", 
  2188   2189               iIn-7, &zUri[7]);
  2189   2190           rc = SQLITE_ERROR;
  2190   2191           goto parse_uri_out;
  2191   2192         }
  2192         -    }else{
  2193         -      iIn = 5;
  2194   2193       }
         2194  +#endif
  2195   2195   
  2196   2196       /* Copy the filename and any query parameters into the zFile buffer. 
  2197   2197       ** Decode %HH escape codes along the way. 
  2198   2198       **
  2199   2199       ** Within this loop, variable eState may be set to 0, 1 or 2, depending
  2200   2200       ** on the parsing context. As follows:
  2201   2201       **