mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath: Update documentation for builtin types Adding an identifier to the SMTP blocklist notices for duplicate suppression. Doc fixes for signature 'eval' conditions. Remove orphaned unit tests. Add type checking for signature 'eval' condition functions.
This commit is contained in:
commit
6dd43ea017
17 changed files with 121 additions and 44 deletions
|
@ -126,6 +126,23 @@ RuleConditionEval::RuleConditionEval(const char* func)
|
|||
rules_error("unknown identifier", func);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( id->Type()->Tag() == TYPE_FUNC )
|
||||
{
|
||||
// Validate argument quantity and type.
|
||||
FuncType* f = id->Type()->AsFuncType();
|
||||
|
||||
if ( f->YieldType()->Tag() != TYPE_BOOL )
|
||||
rules_error("eval function type must yield a 'bool'", func);
|
||||
|
||||
TypeList tl;
|
||||
tl.Append(internal_type("signature_state")->Ref());
|
||||
tl.Append(base_type(TYPE_STRING));
|
||||
|
||||
if ( ! f->CheckArgs(tl.Types()) )
|
||||
rules_error("eval function parameters must be a 'signature_state' "
|
||||
"and a 'string' type", func);
|
||||
}
|
||||
}
|
||||
|
||||
bool RuleConditionEval::DoMatch(Rule* rule, RuleEndpointState* state,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue