Unclassified field type can be either string or integer

Don't produce warnings for such types
This commit is contained in:
Aleksei Nikiforov 2020-01-10 12:03:29 +03:00
parent 517d5d87c4
commit c99829625f

View File

@ -69,12 +69,19 @@ std::function<bool(const std::string &)> interpreted_string_record_type_check_fu
};
}
std::function<bool(const std::string &)> any_record_type_check_function()
{
return [](const std::string &value) -> bool {
return true;
};
}
} // unnamed namespace
#define register_record_type(audit_type, check_function) \
static const AuditTypeCheckRegister audit_type_check_register_##audit_type(audit_type, check_function)
register_record_type(AUPARSE_TYPE_UNCLASSIFIED, interpreted_string_record_type_check_function());
register_record_type(AUPARSE_TYPE_UNCLASSIFIED, any_record_type_check_function());
register_record_type(AUPARSE_TYPE_UID, integer_record_type_check_function());
register_record_type(AUPARSE_TYPE_GID, integer_record_type_check_function());
register_record_type(AUPARSE_TYPE_SYSCALL, integer_record_type_check_function());