diff options
author | Wez Furlong <wez@php.net> | 2004-07-10 12:27:51 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2004-07-10 12:27:51 +0000 |
commit | e563b4eafa63ba8beb88defa1e36f037a7a97a60 (patch) | |
tree | 2e72dfa1c4b7fe62fde9ab326a67047ba2f4cc9e /ext/sqlite/libsqlite/src/auth.c | |
parent | cd732f1a3f5df97407797fe7ebb97830552479ad (diff) | |
download | php-git-e563b4eafa63ba8beb88defa1e36f037a7a97a60.tar.gz |
Upgrade bundled library to 2.8.14 + misc fixes
(http://www.sqlite.org/cvstrac/chngview?cn=1742)
Diffstat (limited to 'ext/sqlite/libsqlite/src/auth.c')
-rw-r--r-- | ext/sqlite/libsqlite/src/auth.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/ext/sqlite/libsqlite/src/auth.c b/ext/sqlite/libsqlite/src/auth.c index 06b8126ae0..3f861c710d 100644 --- a/ext/sqlite/libsqlite/src/auth.c +++ b/ext/sqlite/libsqlite/src/auth.c @@ -85,12 +85,9 @@ int sqlite_set_authorizer( ** user-supplied authorization function returned an illegal value. */ static void sqliteAuthBadReturnCode(Parse *pParse, int rc){ - char zBuf[20]; - sprintf(zBuf, "(%d)", rc); - sqliteSetString(&pParse->zErrMsg, "illegal return value ", zBuf, - " from the authorization function - should be SQLITE_OK, " - "SQLITE_IGNORE, or SQLITE_DENY", (char*)0); - pParse->nErr++; + sqliteErrorMsg(pParse, "illegal return value (%d) from the " + "authorization function - should be SQLITE_OK, SQLITE_IGNORE, " + "or SQLITE_DENY", rc); pParse->rc = SQLITE_MISUSE; } @@ -150,13 +147,11 @@ void sqliteAuthRead( pExpr->op = TK_NULL; }else if( rc==SQLITE_DENY ){ if( db->nDb>2 || pExpr->iDb!=0 ){ - sqliteSetString(&pParse->zErrMsg,"access to ", zDBase, ".", - pTab->zName, ".", zCol, " is prohibited", (char*)0); + sqliteErrorMsg(pParse, "access to %s.%s.%s is prohibited", + zDBase, pTab->zName, zCol); }else{ - sqliteSetString(&pParse->zErrMsg,"access to ", pTab->zName, ".", - zCol, " is prohibited", (char*)0); + sqliteErrorMsg(pParse, "access to %s.%s is prohibited", pTab->zName,zCol); } - pParse->nErr++; pParse->rc = SQLITE_AUTH; }else if( rc!=SQLITE_OK ){ sqliteAuthBadReturnCode(pParse, rc); @@ -179,14 +174,13 @@ int sqliteAuthCheck( sqlite *db = pParse->db; int rc; - if( db->xAuth==0 ){ + if( db->init.busy || db->xAuth==0 ){ return SQLITE_OK; } rc = db->xAuth(db->pAuthArg, code, zArg1, zArg2, zArg3, pParse->zAuthContext); if( rc==SQLITE_DENY ){ - sqliteSetString(&pParse->zErrMsg, "not authorized", (char*)0); + sqliteErrorMsg(pParse, "not authorized"); pParse->rc = SQLITE_AUTH; - pParse->nErr++; }else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){ rc = SQLITE_DENY; sqliteAuthBadReturnCode(pParse, rc); |