My biggest worry here is that it is not clear that "enabling all parsers" is sufficient for things to work correctly during runtime. In the above-referenced commit, some of the code enables other options. For example, that official ClamAV commit has the following new example code in examples/ex1.c:
It looks like ClamAV developers rushed this change without thinking it through. Perhaps they will polish the interface or at least document what the correct CL_SCAN_STDOPT replacement is when this new ClamAV code becomes officially stable.
Ironically, the now-missing CL_SCAN_STDOPT constant was documented to "make your software ready for new features in the future versions of libclamav".
For the record, the constant was removed in this ClamAV commit that replaced a single options bitmask with a structure of themed options:
https:/ /github. com/Cisco- Talos/clamav- devel/commit/ 048a88e61558726 bd9ba66ec3195b6 3d61d8a430# diff-62d8b38a94 94ba8e4e7a6fad6 d61a935L181
The patch proposed here will fix compilation with ClamAV v0.101, but break compilation with older versions.
A better patch will make those changes conditional on CL_SCAN_STDOPT absence. There is an (imperfect) example at https:/ /github. com/cyrusimap/ cyrus-imapd/ issues/ 2621
My biggest worry here is that it is not clear that "enabling all parsers" is sufficient for things to work correctly during runtime. In the above-referenced commit, some of the code enables other options. For example, that official ClamAV commit has the following new example code in examples/ex1.c:
options.parse |= ~0; /* enable all parsers */ GENERAL_ HEURISTICS; /* enable heuristic alert options */
options.general |= CL_SCAN_
It looks like ClamAV developers rushed this change without thinking it through. Perhaps they will polish the interface or at least document what the correct CL_SCAN_STDOPT replacement is when this new ClamAV code becomes officially stable.