Comment 5 for bug 1813962

Revision history for this message
Alex Rousskov (rousskov) wrote :

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/048a88e61558726bd9ba66ec3195b63d61d8a430#diff-62d8b38a9494ba8e4e7a6fad6d61a935L181

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 */
    options.general |= CL_SCAN_GENERAL_HEURISTICS; /* enable heuristic alert options */

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.