0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 15:30:52 +01:00

modules/vm: Check auth during eval.

This commit is contained in:
Jason Volk 2019-08-17 06:37:43 -07:00
parent 7cc37e517a
commit 7fa5948fd3
2 changed files with 7 additions and 0 deletions

View file

@ -156,6 +156,9 @@ struct ircd::m::vm::opts
/// Call eval hooks or false to bypass this stage.
bool eval {true};
/// Perform auth or false to bypass this state.
bool auth {true};
/// Make writes to database
bool write {true};

View file

@ -896,6 +896,10 @@ ircd::m::vm::execute_pdu(eval &eval,
if(opts.fetch)
call_hook(fetch_hook, eval, event, eval);
// Evaluation by auth system; throws
if(opts.auth && !internal(room_id))
event::auth::check(event);
// Obtain sequence number here.
const auto *const &top(eval::seqmax());
eval.sequence_shared[0] = 0;