diff options
author | drh <drh@noemail.net> | 2003-01-31 17:21:49 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2003-01-31 17:21:49 +0000 |
commit | dcd997ea2ec92c08506c56490cf6109a9611eafc (patch) | |
tree | 59141aa74510bf9bb129ca235d0b3a2b6eef50cd /src/auth.c | |
parent | 88eee38afda94f0ac0371626455dc875767e1263 (diff) | |
download | sqlite-dcd997ea2ec92c08506c56490cf6109a9611eafc.tar.gz sqlite-dcd997ea2ec92c08506c56490cf6109a9611eafc.zip |
The sqlite_exec() function now returns SQLITE_AUTH when authorization fails.
Ticket #231. (CVS 857)
FossilOrigin-Name: d93c1aeb544a5b1056424945eb43854213b30e50
Diffstat (limited to 'src/auth.c')
-rw-r--r-- | src/auth.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/auth.c b/src/auth.c index ca5af14ba..933416fbd 100644 --- a/src/auth.c +++ b/src/auth.c @@ -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; |