diff options
author | drh <drh@noemail.net> | 2019-12-31 22:52:10 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-12-31 22:52:10 +0000 |
commit | b945bcdaf178eabb320aa4609a31ec74233e3115 (patch) | |
tree | 9d6371dc9b2855903cd70f7c2991e87ba5761673 /src/resolve.c | |
parent | 64de2a5f7b77ebad6adda5914976ef4ed09c313a (diff) | |
download | sqlite-b945bcdaf178eabb320aa4609a31ec74233e3115.tar.gz sqlite-b945bcdaf178eabb320aa4609a31ec74233e3115.zip |
Experimental branch with new sqlite3_db_config() options that could possible
enhance security for applications reading potentially compromised database
files.
FossilOrigin-Name: 96a2db2612f2e47bbec0e374a242820c88f03c42ccbf8467abccaef41469bae2
Diffstat (limited to 'src/resolve.c')
-rw-r--r-- | src/resolve.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/resolve.c b/src/resolve.c index a0f9c0f22..36eef4bb4 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -861,6 +861,16 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ ** constant because they are constant for the duration of one query. ** This allows them to be factored out of inner loops. */ ExprSetProperty(pExpr,EP_ConstFunc); + }else{ + if( ExprHasProperty(pExpr, EP_Indirect) + && !IN_RENAME_OBJECT + && (pParse->db->flags & SQLITE_UnsafeInView)==0 + ){ + /* If SQLITE_DBCONFIG_UNSAFE_IN_VIEW is off, then functions with + ** side effects are not allowed inside triggers and views. */ + sqlite3ErrorMsg(pParse, "%s() prohibited in triggers and views", + pDef->zName); + } } if( (pDef->funcFlags & SQLITE_FUNC_CONSTANT)==0 ){ /* Date/time functions that use 'now', and other functions like |