diff options
author | drh <drh@noemail.net> | 2011-02-04 00:51:16 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2011-02-04 00:51:16 +0000 |
commit | 0097eb39422fc18f8e43eef119a43272137d368d (patch) | |
tree | 5b2a5f9fde53bc340498b592001dfa3dc67e2339 /src | |
parent | 767f9a8f9eec3dd9a92448a3eca9c640c5afe7d8 (diff) | |
download | sqlite-0097eb39422fc18f8e43eef119a43272137d368d.tar.gz sqlite-0097eb39422fc18f8e43eef119a43272137d368d.zip |
Fix the ATTACH command so that the filename argument can be any expression
and so that if authorizer callback gets a NULL pointer for the filename
if the filename argument is anything other than a string literal.
Ticket [9013e13dba5b58c7]
FossilOrigin-Name: e64e1453a9c204d93de1af92dc0b3ca26762b024
Diffstat (limited to 'src')
-rw-r--r-- | src/attach.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/attach.c b/src/attach.c index e3dc49d9e..37b61935f 100644 --- a/src/attach.c +++ b/src/attach.c @@ -312,9 +312,11 @@ static void codeAttach( #ifndef SQLITE_OMIT_AUTHORIZATION if( pAuthArg ){ - char *zAuthArg = pAuthArg->u.zToken; - if( NEVER(zAuthArg==0) ){ - goto attach_end; + char *zAuthArg; + if( pAuthArg->op==TK_STRING ){ + zAuthArg = pAuthArg->u.zToken; + }else{ + zAuthArg = 0; } rc = sqlite3AuthCheck(pParse, type, zAuthArg, 0, 0); if(rc!=SQLITE_OK ){ |