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

Function validateAccess

src/jrd/jrd.cpp:728–750  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

726 }
727
728 void validateAccess(thread_db* tdbb, Jrd::Attachment* attachment, SystemPrivilege sp)
729 {
730 if (!attachment->locksmith(tdbb, sp))
731 {
732 PreparedStatement::Builder sql;
733 MetaName missPriv("UNKNOWN");
734 sql << "select" << sql("rdb$type_name", missPriv) << "from rdb$types"
735 << "where rdb$field_name = 'RDB$SYSTEM_PRIVILEGES'"
736 << " and rdb$type =" << SSHORT(sp);
737 jrd_tra* transaction = attachment->getSysTransaction();
738 AutoPreparedStatement ps(attachment->prepareStatement(tdbb, transaction, sql));
739 AutoResultSet rs(ps->executeQuery(tdbb, transaction));
740 rs->fetch(tdbb);
741
742 const UserId* const u = attachment->att_user;
743 Arg::Gds err(isc_adm_task_denied);
744 err << Arg::Gds(isc_miss_prvlg) << missPriv;
745 if (u && u->testFlag(USR_mapdown))
746 err << Arg::Gds(isc_map_down);
747
748 ERR_post(err);
749 }
750 }
751
752
753 class DefaultCallback : public AutoIface<ICryptKeyCallbackImpl<DefaultCallback, CheckStatusWrapper> >

Callers 1

internalAttachMethod · 0.85

Calls 8

GdsClass · 0.85
getSysTransactionMethod · 0.80
prepareStatementMethod · 0.80
executeQueryMethod · 0.80
testFlagMethod · 0.80
ERR_postFunction · 0.70
locksmithMethod · 0.45
fetchMethod · 0.45

Tested by

no test coverage detected