Add authorization callbacks for REINDEX. (CVS 2148)

FossilOrigin-Name: 9f0d744ee4d99f44e88c6f799821791c3b5f31b6
This commit is contained in:
danielk1977
2004-11-23 15:41:16 +00:00
parent 78583d2440
commit 1d54df88e3
6 changed files with 129 additions and 14 deletions
+8 -1
View File
@@ -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 ){
+2 -1
View File
@@ -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 */
/*
+2 -1
View File
@@ -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);