Missing yr_get_version API function
Author: gyunaevCreated Feb 13, 2025Updated Feb 13, 2025
Labelsfeature-request
Is your feature request related to a problem? Please describe.
Many Linux distros provide and distribute libyara.so as a shared library in a separate package from the applications which use Yara. This is advantageous to applications which use libyara since they can benefit from independent updates.
However there is no API in libyara.so which would allow such an application to determine and show the library version of libyara loaded via dlopen() in runtime.
Describe the solution you'd like
Add an API function:
void yr_get_version( int * major, int * minor, int * micro)
{
*major = YR_MAJOR_VERSION;
*minor = YR_MINOR_VERSION;
*micro = YR_MICRO_VERSION;
}or something similar.
Describe alternatives you've considered An alternative would be to rebuild all packages using Yara statically, and stop providing libyara.so but this isn't what Linux distros are doing.
Source: VirusTotal/yara