| OLD | NEW |
| 1 /* | 1 /* |
| 2 ** 2003 January 11 | 2 ** 2003 January 11 |
| 3 ** | 3 ** |
| 4 ** The author disclaims copyright to this source code. In place of | 4 ** The author disclaims copyright to this source code. In place of |
| 5 ** a legal notice, here is a blessing: | 5 ** a legal notice, here is a blessing: |
| 6 ** | 6 ** |
| 7 ** May you do good and not evil. | 7 ** May you do good and not evil. |
| 8 ** May you find forgiveness for yourself and forgive others. | 8 ** May you find forgiveness for yourself and forgive others. |
| 9 ** May you share freely, never taking more than you give. | 9 ** May you share freely, never taking more than you give. |
| 10 ** | 10 ** |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 ** and attempts to write the column will be ignored. | 65 ** and attempts to write the column will be ignored. |
| 66 ** | 66 ** |
| 67 ** Setting the auth function to NULL disables this hook. The default | 67 ** Setting the auth function to NULL disables this hook. The default |
| 68 ** setting of the auth function is NULL. | 68 ** setting of the auth function is NULL. |
| 69 */ | 69 */ |
| 70 int sqlite3_set_authorizer( | 70 int sqlite3_set_authorizer( |
| 71 sqlite3 *db, | 71 sqlite3 *db, |
| 72 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), | 72 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), |
| 73 void *pArg | 73 void *pArg |
| 74 ){ | 74 ){ |
| 75 #ifdef SQLITE_ENABLE_API_ARMOR |
| 76 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| 77 #endif |
| 75 sqlite3_mutex_enter(db->mutex); | 78 sqlite3_mutex_enter(db->mutex); |
| 76 db->xAuth = (sqlite3_xauth)xAuth; | 79 db->xAuth = (sqlite3_xauth)xAuth; |
| 77 db->pAuthArg = pArg; | 80 db->pAuthArg = pArg; |
| 78 sqlite3ExpirePreparedStatements(db); | 81 sqlite3ExpirePreparedStatements(db); |
| 79 sqlite3_mutex_leave(db->mutex); | 82 sqlite3_mutex_leave(db->mutex); |
| 80 return SQLITE_OK; | 83 return SQLITE_OK; |
| 81 } | 84 } |
| 82 | 85 |
| 83 /* | 86 /* |
| 84 ** Write an error message into pParse->zErrMsg that explains that the | 87 ** Write an error message into pParse->zErrMsg that explains that the |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 ** by sqlite3AuthContextPush | 251 ** by sqlite3AuthContextPush |
| 249 */ | 252 */ |
| 250 void sqlite3AuthContextPop(AuthContext *pContext){ | 253 void sqlite3AuthContextPop(AuthContext *pContext){ |
| 251 if( pContext->pParse ){ | 254 if( pContext->pParse ){ |
| 252 pContext->pParse->zAuthContext = pContext->zAuthContext; | 255 pContext->pParse->zAuthContext = pContext->zAuthContext; |
| 253 pContext->pParse = 0; | 256 pContext->pParse = 0; |
| 254 } | 257 } |
| 255 } | 258 } |
| 256 | 259 |
| 257 #endif /* SQLITE_OMIT_AUTHORIZATION */ | 260 #endif /* SQLITE_OMIT_AUTHORIZATION */ |
| OLD | NEW |