mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
The sqlite_exec() function now returns SQLITE_AUTH when authorization fails.
Ticket #231. (CVS 857) FossilOrigin-Name: d93c1aeb544a5b1056424945eb43854213b30e50
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
** systems that do not need this facility may omit it by recompiling
|
||||
** the library with -DSQLITE_OMIT_AUTHORIZATION=1
|
||||
**
|
||||
** $Id: auth.c,v 1.3 2003/01/13 23:27:32 drh Exp $
|
||||
** $Id: auth.c,v 1.4 2003/01/31 17:21:50 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@@ -71,6 +71,7 @@ static void sqliteAuthBadReturnCode(Parse *pParse, int rc){
|
||||
" from the authorization function - should be SQLITE_OK, "
|
||||
"SQLITE_IGNORE, or SQLITE_DENY", 0);
|
||||
pParse->nErr++;
|
||||
pParse->rc = SQLITE_MISUSE;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -113,6 +114,7 @@ void sqliteAuthRead(
|
||||
sqliteSetString(&pParse->zErrMsg,"access to ",
|
||||
pTab->zName, ".", zCol, " is prohibited", 0);
|
||||
pParse->nErr++;
|
||||
pParse->rc = SQLITE_AUTH;
|
||||
}else if( rc!=SQLITE_OK ){
|
||||
sqliteAuthBadReturnCode(pParse, rc);
|
||||
}
|
||||
@@ -138,6 +140,7 @@ int sqliteAuthCheck(
|
||||
rc = db->xAuth(db->pAuthArg, code, zArg1, zArg2);
|
||||
if( rc==SQLITE_DENY ){
|
||||
sqliteSetString(&pParse->zErrMsg, "not authorized", 0);
|
||||
pParse->rc = SQLITE_AUTH;
|
||||
pParse->nErr++;
|
||||
}else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){
|
||||
rc = SQLITE_DENY;
|
||||
|
Reference in New Issue
Block a user