OLD | NEW |
1 /* | 1 /* |
2 ** 2014-09-08 | 2 ** 2014-09-08 |
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 ** |
11 ************************************************************************* | 11 ************************************************************************* |
12 ** | 12 ** |
13 ** This file contains the bulk of the implementation of the | 13 ** This file contains the bulk of the implementation of the |
14 ** user-authentication extension feature. Some parts of the user- | 14 ** user-authentication extension feature. Some parts of the user- |
15 ** authentication code are contained within the SQLite core (in the | 15 ** authentication code are contained within the SQLite core (in the |
16 ** src/ subdirectory of the main source code tree) but those parts | 16 ** src/ subdirectory of the main source code tree) but those parts |
17 ** that could reasonable be separated out are moved into this file. | 17 ** that could reasonable be separated out are moved into this file. |
18 ** | 18 ** |
19 ** To compile with the user-authentication feature, append this file to | 19 ** To compile with the user-authentication feature, append this file to |
20 ** end of an SQLite amalgamation, then add the SQLITE_USER_AUTHENTICATION | 20 ** end of an SQLite amalgamation, then add the SQLITE_USER_AUTHENTICATION |
21 ** compile-time option. See the user-auth.txt file in the same source | 21 ** compile-time option. See the user-auth.txt file in the same source |
22 ** directory as this file for additional information. | 22 ** directory as this file for additional information. |
23 */ | 23 */ |
24 #ifdef SQLITE_USER_AUTHENTICATION | 24 #ifdef SQLITE_USER_AUTHENTICATION |
25 #ifndef _SQLITEINT_H_ | 25 #ifndef SQLITEINT_H |
26 # include "sqliteInt.h" | 26 # include "sqliteInt.h" |
27 #endif | 27 #endif |
28 | 28 |
29 /* | 29 /* |
30 ** Prepare an SQL statement for use by the user authentication logic. | 30 ** Prepare an SQL statement for use by the user authentication logic. |
31 ** Return a pointer to the prepared statement on success. Return a | 31 ** Return a pointer to the prepared statement on success. Return a |
32 ** NULL pointer if there is an error of any kind. | 32 ** NULL pointer if there is an error of any kind. |
33 */ | 33 */ |
34 static sqlite3_stmt *sqlite3UserAuthPrepare( | 34 static sqlite3_stmt *sqlite3UserAuthPrepare( |
35 sqlite3 *db, | 35 sqlite3 *db, |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 return SQLITE_OK; | 346 return SQLITE_OK; |
347 } | 347 } |
348 pStmt = sqlite3UserAuthPrepare(db, | 348 pStmt = sqlite3UserAuthPrepare(db, |
349 "DELETE FROM sqlite_user WHERE uname=%Q", zUsername); | 349 "DELETE FROM sqlite_user WHERE uname=%Q", zUsername); |
350 if( pStmt==0 ) return SQLITE_NOMEM; | 350 if( pStmt==0 ) return SQLITE_NOMEM; |
351 sqlite3_step(pStmt); | 351 sqlite3_step(pStmt); |
352 return sqlite3_finalize(pStmt); | 352 return sqlite3_finalize(pStmt); |
353 } | 353 } |
354 | 354 |
355 #endif /* SQLITE_USER_AUTHENTICATION */ | 355 #endif /* SQLITE_USER_AUTHENTICATION */ |
OLD | NEW |