From 19788ff96d53b5817b3106edea5cbf6a58aebbd5 Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Mon, 3 Oct 2016 22:32:15 -0300 Subject: [PATCH] Misc. --- doc/sql.extensions/README.sql_security.txt | 3 ++- src/burp/backup.epp | 18 +++++++++--------- src/burp/burp.h | 3 ++- src/burp/restore.epp | 2 +- src/dsql/StmtNodes.cpp | 4 ++-- src/jrd/cch.cpp | 2 +- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/doc/sql.extensions/README.sql_security.txt b/doc/sql.extensions/README.sql_security.txt index 189fe77a00..e69ca55770 100644 --- a/doc/sql.extensions/README.sql_security.txt +++ b/doc/sql.extensions/README.sql_security.txt @@ -18,7 +18,7 @@ CREATE [OR ALTER] PACKAGE [SQL SECURITY {DEFINER | INVOKER}] AS .. Description: Makes it possible to execute some objects with permissions of either definer or invoker. -By default INVOKER is used to keep backword compatibility. +By default INVOKER is used to keep backward compatibility. If INVOKER is specified a current set of privileges of the current user will be used. If DEFINER - a set of privileges of object owner will be used to check an access to database objects used by this object. @@ -154,6 +154,7 @@ commit; connect 'localhost:/tmp/69.fdb' user us password 'pas'; select pk.f(3) from rdb$database; + Example 6. Altering explicit option SQL SECURITY for triggers. To remove explicit SQL SECURITY OPTION from trigger you can execute: alter trigger tr_ins drop sql security; diff --git a/src/burp/backup.epp b/src/burp/backup.epp index 3b139b6544..d639ea50dd 100644 --- a/src/burp/backup.epp +++ b/src/burp/backup.epp @@ -2012,15 +2012,15 @@ void put_int64(att_type attribute, SINT64 value) void put_boolean(att_type attribute, const FB_BOOLEAN value) { - /************************************** - * - * p u t _ b o o l e a n - * - ************************************** - * - * Functional description - * Write a FB_BOOLEAN value as an attribute. - **************************************/ +/************************************** + * + * p u t _ b o o l e a n + * + ************************************** + * + * Functional description + * Write a FB_BOOLEAN value as an attribute. + **************************************/ BurpGlobals* tdgbl = BurpGlobals::getSpecific(); put(tdgbl, attribute); diff --git a/src/burp/burp.h b/src/burp/burp.h index 46c91b80b3..f605689c9c 100644 --- a/src/burp/burp.h +++ b/src/burp/burp.h @@ -198,7 +198,8 @@ Version 9: FB2.5. Version 10: FB3.0. See backup_capabilities in OdsDetection.h. -Version 11: FB 4.0 +Version 11: FB4.0. + SQL SECURITY feature. */ const int ATT_BACKUP_FORMAT = 11; diff --git a/src/burp/restore.epp b/src/burp/restore.epp index 439bfecb5c..6c2a13b94d 100644 --- a/src/burp/restore.epp +++ b/src/burp/restore.epp @@ -7333,7 +7333,7 @@ bool get_relation(BurpGlobals* tdgbl) rel_desc = isc_blob_null, ext_desc = isc_blob_null; bool view_blr_null = true, view_src_null = true, rel_desc_null = true, ext_desc_null = true; - FB_BOOLEAN sql_security = 0; + FB_BOOLEAN sql_security = FB_FALSE; bool sql_security_null = true; BASED_ON RDB$RELATIONS.RDB$SECURITY_CLASS sec_class; diff --git a/src/dsql/StmtNodes.cpp b/src/dsql/StmtNodes.cpp index 7cb1ea8f0e..d16627cede 100644 --- a/src/dsql/StmtNodes.cpp +++ b/src/dsql/StmtNodes.cpp @@ -6440,7 +6440,7 @@ DmlNode* StoreNode::parse(thread_db* tdbb, MemoryPool& pool, CompilerScratch* cs return node; } -StmtNode* StoreNode::internalDsqlPass(DsqlCompilerScratch* dsqlScratch, +StmtNode* StoreNode::internalDsqlPass(DsqlCompilerScratch* dsqlScratch, bool updateOrInsert, bool& needSavePoint) { thread_db* tdbb = JRD_get_thread_data(); // necessary? @@ -6608,7 +6608,7 @@ StmtNode* StoreNode::internalDsqlPass(DsqlCompilerScratch* dsqlScratch, StmtNode* StoreNode::dsqlPass(DsqlCompilerScratch* dsqlScratch) { bool needSavePoint; - StmtNode* node = SavepointEncloseNode::make(getPool(), dsqlScratch, + StmtNode* node = SavepointEncloseNode::make(getPool(), dsqlScratch, internalDsqlPass(dsqlScratch, false, needSavePoint)); if (!needSavePoint || node->is()) diff --git a/src/jrd/cch.cpp b/src/jrd/cch.cpp index 54a77bbc8a..7fca947b81 100644 --- a/src/jrd/cch.cpp +++ b/src/jrd/cch.cpp @@ -1560,7 +1560,7 @@ void CCH_must_write(thread_db* tdbb, WIN* window) } bdb->bdb_flags |= BDB_must_write | BDB_dirty; - fb_assert(bdb->bdb_flags & BDB_nbak_state_lock || + fb_assert(bdb->bdb_flags & BDB_nbak_state_lock || PageSpace::isTemporary(bdb->bdb_page.getPageSpaceID())); }