diff options
| author | 2017-02-09 04:37:26 -0500 | |
|---|---|---|
| committer | 2017-02-09 04:37:26 -0500 | |
| commit | c9d6debf9015b7853c3e061bbc64a555d85e2fcd (patch) | |
| tree | 53341bc57ae9fbad2beb5b6c08d97a68bee0ec8e /Plugins/DbSqliteWx/sqlite3userauth.h | |
| parent | d5caba2b1f36dc3b92fa705a06097d0597fa2ddd (diff) | |
| parent | d9aa870e5d509cc7309ab82dd102a937ab58613a (diff) | |
Merge tag 'upstream/3.1.1+dfsg1'
Upstream version 3.1.1+dfsg1
# gpg: Signature made Thu 09 Feb 2017 04:37:24 AM EST
# gpg: using RSA key 5001E1B09AA3744B
# gpg: issuer "unit193@ubuntu.com"
# gpg: Good signature from "Unit 193 <unit193@ubuntu.com>" [unknown]
# gpg: aka "Unit 193 <unit193@gmail.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 8DB3 E586 865D 2B4A 2B18 5A5C 5001 E1B0 9AA3 744B
Diffstat (limited to 'Plugins/DbSqliteWx/sqlite3userauth.h')
| -rw-r--r-- | Plugins/DbSqliteWx/sqlite3userauth.h | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/Plugins/DbSqliteWx/sqlite3userauth.h b/Plugins/DbSqliteWx/sqlite3userauth.h new file mode 100644 index 0000000..69f743b --- /dev/null +++ b/Plugins/DbSqliteWx/sqlite3userauth.h @@ -0,0 +1,89 @@ +/*
+** 2014-09-08
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+**
+** This file contains the application interface definitions for the
+** user-authentication extension feature.
+**
+** To compile with the user-authentication feature, append this file to
+** end of an SQLite amalgamation header file ("wx_sqlite3.h"), then add
+** the SQLITE_USER_AUTHENTICATION compile-time option. See the
+** user-auth.txt file in the same source directory as this file for
+** additional information.
+*/
+#ifdef SQLITE_USER_AUTHENTICATION
+
+/*
+** If a database contains the SQLITE_USER table, then the
+** wx_sqlite3_user_authenticate() interface must be invoked with an
+** appropriate username and password prior to enable read and write
+** access to the database.
+**
+** Return SQLITE_OK on success or SQLITE_ERROR if the username/password
+** combination is incorrect or unknown.
+**
+** If the SQLITE_USER table is not present in the database file, then
+** this interface is a harmless no-op returnning SQLITE_OK.
+*/
+int wx_sqlite3_user_authenticate(
+ wx_sqlite3 *db, /* The database connection */
+ const char *zUsername, /* Username */
+ const char *aPW, /* Password or credentials */
+ int nPW /* Number of bytes in aPW[] */
+);
+
+/*
+** The wx_sqlite3_user_add() interface can be used (by an admin user only)
+** to create a new user. When called on a no-authentication-required
+** database, this routine converts the database into an authentication-
+** required database, automatically makes the added user an
+** administrator, and logs in the current connection as that user.
+** The wx_sqlite3_user_add() interface only works for the "main" database, not
+** for any ATTACH-ed databases. Any call to wx_sqlite3_user_add() by a
+** non-admin user results in an error.
+*/
+int wx_sqlite3_user_add(
+ wx_sqlite3 *db, /* Database connection */
+ const char *zUsername, /* Username to be added */
+ const char *aPW, /* Password or credentials */
+ int nPW, /* Number of bytes in aPW[] */
+ int isAdmin /* True to give new user admin privilege */
+);
+
+/*
+** The wx_sqlite3_user_change() interface can be used to change a users
+** login credentials or admin privilege. Any user can change their own
+** login credentials. Only an admin user can change another users login
+** credentials or admin privilege setting. No user may change their own
+** admin privilege setting.
+*/
+int wx_sqlite3_user_change(
+ wx_sqlite3 *db, /* Database connection */
+ const char *zUsername, /* Username to change */
+ const char *aPW, /* New password or credentials */
+ int nPW, /* Number of bytes in aPW[] */
+ int isAdmin /* Modified admin privilege for the user */
+);
+
+/*
+** The wx_sqlite3_user_delete() interface can be used (by an admin user only)
+** to delete a user. The currently logged-in user cannot be deleted,
+** which guarantees that there is always an admin user and hence that
+** the database cannot be converted into a no-authentication-required
+** database.
+*/
+int wx_sqlite3_user_delete(
+ wx_sqlite3 *db, /* Database connection */
+ const char *zUsername /* Username to remove */
+);
+
+#endif /* SQLITE_USER_AUTHENTICATION */
+
|
