MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / checkBlob

Method checkBlob

src/jrd/tra.cpp:4097–4192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4095}
4096
4097void jrd_tra::checkBlob(thread_db* tdbb, const bid* blob_id, jrd_fld* fld, bool punt)
4098{
4099 const USHORT rel_id = blob_id->bid_internal.bid_relation_id;
4100
4101 if (rel_id == 0 ||
4102 (tra_flags & TRA_no_blob_check) ||
4103 tra_attachment->locksmith(tdbb, SELECT_ANY_OBJECT_IN_DATABASE))
4104 {
4105 return;
4106 }
4107
4108 if (!tra_blobs->locate(blob_id->bid_temp_id()) &&
4109 !tra_fetched_blobs.locate(*blob_id))
4110 {
4111 vec<jrd_rel*>* vector = tra_attachment->att_relations;
4112 jrd_rel* blb_relation;
4113
4114 if ((rel_id < vector->count() && (blb_relation = (*vector)[rel_id])) ||
4115 (blb_relation = MET_relation(tdbb, rel_id)))
4116 {
4117 MetaName security_name = (fld && fld->fld_security_name.hasData()) ?
4118 fld->fld_security_name : blb_relation->rel_security_name;
4119
4120 if (security_name.isEmpty())
4121 {
4122 MET_scan_relation(tdbb, blb_relation);
4123 security_name = blb_relation->rel_security_name;
4124 }
4125
4126 SecurityClass* s_class = SCL_get_class(tdbb, security_name.c_str());
4127
4128 if (!s_class)
4129 return;
4130
4131 switch (s_class->scl_blb_access)
4132 {
4133 case SecurityClass::BA_UNKNOWN:
4134 // Relation (or field) has not been checked for access rights
4135 try
4136 {
4137 ThreadStatusGuard status_vector(tdbb);
4138
4139 if (fld)
4140 {
4141 SCL_check_access(tdbb, s_class, 0, 0, SCL_select, obj_column,
4142 false, fld->fld_name, blb_relation->rel_name);
4143 }
4144 else
4145 {
4146 SCL_check_access(tdbb, s_class, 0, 0, SCL_select, obj_relations,
4147 false, blb_relation->rel_name);
4148 }
4149
4150 s_class->scl_blb_access = SecurityClass::BA_SUCCESS;
4151 }
4152 catch (const Exception& ex)
4153 {
4154 StaticStatusVector status;

Callers 4

executeMethod · 0.80
openBlobMethod · 0.80
EXE_receiveFunction · 0.80
open2Method · 0.80

Calls 12

GdsClass · 0.85
StrClass · 0.85
ERR_postFunction · 0.70
locksmithMethod · 0.45
locateMethod · 0.45
bid_temp_idMethod · 0.45
countMethod · 0.45
hasDataMethod · 0.45
isEmptyMethod · 0.45
c_strMethod · 0.45
stuffExceptionMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected