diff options
author | danielk1977 <danielk1977@noemail.net> | 2004-11-23 15:41:16 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2004-11-23 15:41:16 +0000 |
commit | 1d54df88e3edeaf8dee6785fadeea3fc403a8a03 (patch) | |
tree | 5c5b48028f648a57db3e97562aee670083909a3b /src | |
parent | 78583d24405e9c58290f4c5308d718a0986a9f85 (diff) | |
download | sqlite-1d54df88e3edeaf8dee6785fadeea3fc403a8a03.tar.gz sqlite-1d54df88e3edeaf8dee6785fadeea3fc403a8a03.zip |
Add authorization callbacks for REINDEX. (CVS 2148)
FossilOrigin-Name: 9f0d744ee4d99f44e88c6f799821791c3b5f31b6
Diffstat (limited to 'src')
-rw-r--r-- | src/build.c | 9 | ||||
-rw-r--r-- | src/sqlite.h.in | 3 | ||||
-rw-r--r-- | src/tclsqlite.c | 3 |
3 files changed, 12 insertions, 3 deletions
diff --git a/src/build.c b/src/build.c index 17c2986ad..df427712f 100644 --- a/src/build.c +++ b/src/build.c @@ -22,7 +22,7 @@ ** COMMIT ** ROLLBACK ** -** $Id: build.c,v 1.286 2004/11/22 11:51:13 danielk1977 Exp $ +** $Id: build.c,v 1.287 2004/11/23 15:41:16 danielk1977 Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -2039,6 +2039,13 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){ Vdbe *v; /* Generate code into this virtual machine */ int isUnique; /* True for a unique index */ +#ifndef SQLITE_OMIT_AUTHORIZATION + if( sqlite3AuthCheck(pParse, SQLITE_REINDEX, pIndex->zName, 0, + pParse->db->aDb[pIndex->iDb].zName ) ){ + return; + } +#endif + v = sqlite3GetVdbe(pParse); if( v==0 ) return; if( memRootPage>=0 ){ diff --git a/src/sqlite.h.in b/src/sqlite.h.in index bad399e36..bc1734417 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -12,7 +12,7 @@ ** This header file defines the interface that the SQLite library ** presents to client programs. ** -** @(#) $Id: sqlite.h.in,v 1.123 2004/11/20 06:05:56 danielk1977 Exp $ +** @(#) $Id: sqlite.h.in,v 1.124 2004/11/23 15:41:16 danielk1977 Exp $ */ #ifndef _SQLITE3_H_ #define _SQLITE3_H_ @@ -429,6 +429,7 @@ int sqlite3_set_authorizer( #define SQLITE_ATTACH 24 /* Filename NULL */ #define SQLITE_DETACH 25 /* Database Name NULL */ #define SQLITE_ALTER_TABLE 26 /* Database Name Table Name */ +#define SQLITE_REINDEX 27 /* Index Name NULL */ /* diff --git a/src/tclsqlite.c b/src/tclsqlite.c index fa82058d0..1ef3f6e37 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -11,7 +11,7 @@ ************************************************************************* ** A TCL Interface to SQLite ** -** $Id: tclsqlite.c,v 1.107 2004/11/12 15:53:37 danielk1977 Exp $ +** $Id: tclsqlite.c,v 1.108 2004/11/23 15:41:16 danielk1977 Exp $ */ #ifndef NO_TCL /* Omit this whole file if TCL is unavailable */ @@ -288,6 +288,7 @@ static int auth_callback( case SQLITE_ATTACH : zCode="SQLITE_ATTACH"; break; case SQLITE_DETACH : zCode="SQLITE_DETACH"; break; case SQLITE_ALTER_TABLE : zCode="SQLITE_ALTER_TABLE"; break; + case SQLITE_REINDEX : zCode="SQLITE_REINDEX"; break; default : zCode="????"; break; } Tcl_DStringInit(&str); |