Add support for the extra parameter on the sqlite3_set_authorizer() callback
and support for failing an ATTACH with an authentication-required database
using bad credentials. The extension is now feature complete, but much
testing and bug-fixing remains.
FossilOrigin-Name: 596e728b0eb19a34c888e33d4d37978ca2bf1e00
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 9ef4e36..a9f2001 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -1012,9 +1012,19 @@
int sqlite3UserAuthCheckLogin(sqlite3*,const char*,u8*);
void sqlite3CryptFunc(sqlite3_context*,int,sqlite3_value**);
-
#endif /* SQLITE_USER_AUTHENTICATION */
+/*
+** typedef for the authorization callback function.
+*/
+#ifdef SQLITE_USER_AUTHENTICATION
+ typedef int (*sqlite3_xauth)(void*,int,const char*,const char*,const char*,
+ const char*, const char*);
+#else
+ typedef int (*sqlite3_xauth)(void*,int,const char*,const char*,const char*,
+ const char*);
+#endif
+
/*
** Each database connection is an instance of the following structure.
@@ -1083,8 +1093,7 @@
} u1;
Lookaside lookaside; /* Lookaside malloc configuration */
#ifndef SQLITE_OMIT_AUTHORIZATION
- int (*xAuth)(void*,int,const char*,const char*,const char*,const char*);
- /* Access authorization function */
+ sqlite3_xauth xAuth; /* Access authorization function */
void *pAuthArg; /* 1st argument to the access auth function */
#endif
#ifndef SQLITE_OMIT_PROGRESS_CALLBACK