HomeClusterLabs Projects

Low: libcrmcommon: don't validate with first schema for an unknown schema name

Description

Low: libcrmcommon: don't validate with first schema for an unknown schema name

Simplify pcmkvalidate_xml() by using pcmkget_schema(). If the schema is
"none", validate_with() will return TRUE, so we don't need to special-case
that.

This approach fixes a bug: previously, for unknown schema names,
get_schema_version() would have returned -1, and g_list_nth_data() would have
returned the head of the list, so we would attempted validation with the first
schema rather than log an error and return FALSE.

Details

Provenance
kgaillotAuthored on Apr 11 2024, 6:32 PM
Parents
rP2d9d5229d612: Refactor: libcrmcommon: add internal API for getting schema list entry
Branches
Unknown
Tags
Unknown