/ Check-in [c640489d]
Login

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

Overview
Comment:Fix the SQLITE_USER_AUTHENTICATION login check so that the SQLITE_AUTH_USER error code correctly propagates and is not overwritten by SQLITE_ERROR.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c640489db2037f1a284d7b85fa753ccdac1b8f79
User & Date: drh 2016-08-23 14:42:15
Context
2016-08-24
18:21
Sync up the MSVC autoconf makefile. check-in: 77f7c31a user: mistachkin tags: trunk
2016-08-23
14:42
Fix the SQLITE_USER_AUTHENTICATION login check so that the SQLITE_AUTH_USER error code correctly propagates and is not overwritten by SQLITE_ERROR. check-in: c640489d user: drh tags: trunk
2016-08-22
20:10
Add support for the SQLITE_DBCONFIG_MAINDBNAME configuration option. check-in: 78395193 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/build.c.

149
150
151
152
153
154
155
156
157

158
159
160
161
162
163
164
    while( sqlite3VdbeDeletePriorOpcode(v, OP_Close) ){}
    sqlite3VdbeAddOp0(v, OP_Halt);

#if SQLITE_USER_AUTHENTICATION
    if( pParse->nTableLock>0 && db->init.busy==0 ){
      sqlite3UserAuthInit(db);
      if( db->auth.authLevel<UAUTH_User ){
        pParse->rc = SQLITE_AUTH_USER;
        sqlite3ErrorMsg(pParse, "user not authenticated");

        return;
      }
    }
#endif

    /* The cookie mask contains one bit for each database file open.
    ** (Bit 0 is for main, bit 1 is for temp, and so forth.)  Bits are







<

>







149
150
151
152
153
154
155

156
157
158
159
160
161
162
163
164
    while( sqlite3VdbeDeletePriorOpcode(v, OP_Close) ){}
    sqlite3VdbeAddOp0(v, OP_Halt);

#if SQLITE_USER_AUTHENTICATION
    if( pParse->nTableLock>0 && db->init.busy==0 ){
      sqlite3UserAuthInit(db);
      if( db->auth.authLevel<UAUTH_User ){

        sqlite3ErrorMsg(pParse, "user not authenticated");
        pParse->rc = SQLITE_AUTH_USER;
        return;
      }
    }
#endif

    /* The cookie mask contains one bit for each database file open.
    ** (Bit 0 is for main, bit 1 is for temp, and so forth.)  Bits are