Allow metadata to contain a list of values#201
Allow metadata to contain a list of values#201plusvic merged 3 commits intoVirusTotal:masterfrom cccs-rs:master
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). For more information, open the CLA check for this pull request. |
|
But this breaks backward compatibility, right? People that are already using |
Could a flag in Not sure if it's ideal to have a special function that outputs arrays for all metadata since it could just be a flag that changes the output from |
|
Yes, an argument |
|
bump? |
|
bump |
4 similar comments
|
bump |
|
bump |
|
bump |
|
bump |
|
bump |
|
@cccs-rs, adding the same comment every week is not going to speed up things. It's ok to ping the maintainers from time to time, but not at this rate. |
yara-python.c
Outdated
| PyDict_SetItemString(meta_list, meta->identifier, object); | ||
| Py_DECREF(object); | ||
|
|
||
| if (CALLBACK_ALLOW_DUPLICATES){ |
There was a problem hiding this comment.
The use of the global variable CALLBACK_ALLOW_DUPLICATES is not safe with concurrent code. A better solution is adding a new field allow_duplicate_metadata to the CALLBACK_DATA structure. This field would be initialized with the value passed to match, and the callback function receives a pointer to CALLBACK_DATA where all the context about the current scan can be found.
There was a problem hiding this comment.
Updated, thanks for the feedback! 😀
|
I also miss a test case for this new feature. |
Derivation of: #74 😍
This allows the
Match.metavalues to becomes lists if there are rule meta with the same name but different values. This is also to bring output from the Python library more inline with the output from the commandline.ie. Suppose there's a match given for the following rule:
The corresponding values in
Match.meta['malware']will be:["BAD THING", "REALLY BAD THING"]instead of just"REALLY BAD THING"