aboutsummaryrefslogtreecommitdiff
path: root/src/attach.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2014-09-11 13:44:52 +0000
committerdrh <drh@noemail.net>2014-09-11 13:44:52 +0000
commit32c6a48b5ec977fc849833f9c340b85893103074 (patch)
tree5447aaed784dac0b0d37aef340ce4bb99e0d9afd /src/attach.c
parentd39c40ff5e89601a242f004faa45735e80275fcb (diff)
downloadsqlite-32c6a48b5ec977fc849833f9c340b85893103074.tar.gz
sqlite-32c6a48b5ec977fc849833f9c340b85893103074.zip
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
Diffstat (limited to 'src/attach.c')
-rw-r--r--src/attach.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/attach.c b/src/attach.c
index 89050fd9d..5763e631a 100644
--- a/src/attach.c
+++ b/src/attach.c
@@ -207,6 +207,15 @@ static void attachFunc(
rc = sqlite3Init(db, &zErrDyn);
sqlite3BtreeLeaveAll(db);
}
+#ifdef SQLITE_USER_AUTHENTICATION
+ if( rc==SQLITE_OK ){
+ u8 newAuth = 0;
+ rc = sqlite3UserAuthCheckLogin(db, zName, &newAuth);
+ if( newAuth<db->auth.authLevel ){
+ rc = SQLITE_AUTH;
+ }
+ }
+#endif
if( rc ){
int iDb = db->nDb - 1;
assert( iDb>=2 );