Closed tibibyte closed 7 months ago
This is a known issue (see: https://github.com/VirusTotal/yara-x#duplicate-rule-modifiers-are-not-accepted) that I haven't pay too much attention because it's relatively harmless.
Your solution is partially correct, but don't take into account that private
and global
can appear in arbitrary order. However the solution shouldn't be hard to implement. Would you volunteer for sending a pull request with the solution?
This is a known issue (see: https://github.com/VirusTotal/yara-x#duplicate-rule-modifiers-are-not-accepted) that I haven't pay too much attention because it's relatively harmless.
Your solution is partially correct, but don't take into account that
private
andglobal
can appear in arbitrary order. However the solution shouldn't be hard to implement. Would you volunteer for sending a pull request with the solution?
Sure. I will send a pull request.
Fixed in #2019
YARA accepts rules which use the rule modifiers 'private' and 'global' more than once per rule.
To reproduce this error write a YARA rule like the one depicted below and run it with YARA and a sample.![grafik](https://github.com/VirusTotal/yara/assets/76888898/11854b77-9bfb-4fbf-b500-66c864105da8)
YARA should notify the user that the syntax is not valid according to the documentation by displaying a syntax error.
One possible solution would be to change the grammar in grammar.y like this.