HomeClusterLabs Projects

Doc: libcrmcommon: Clarify doxygen for hash2smartfield()

This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

Doc: libcrmcommon: Clarify doxygen for hash2smartfield()

This is not just for heartbeat compatibility, but rather for safety with
hash table keys that aren't valid XML attribute names.

(Adapted from kgaillot in
https://github.com/ClusterLabs/pacemaker/pull/3316#discussion_r1448033948):

XML attribute names can't start with a number, so this function adds any
such parameters as nvpair children instead of as XML attributes.
xml2list() then parses them.

As written, this hash2smartfield() doesn't offer complete protection.
XML attribute names must start with a letter or underscore and can only
contain certain characters. Rather than trying to check that, we should
probably just use the children always. However, we'd need to verify that
this wouldn't cause any backward compatibility issues.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Jan 10 2024, 11:47 PM

Commit No Longer Exists

This commit no longer exists in the repository.