HomeClusterLabs Projects

Low: libcrmcommon: Ignore text nodes when creating XML patchset

Description

Low: libcrmcommon: Ignore text nodes when creating XML patchset

Node types other than document, element, attribute, and comment
shouldn't occur in a CIB, and they don't get a _private member created
by xml.c:new_private_data(). Pacemaker strips out text nodes from a CIB
and should ignore or throw errors on other unexpected node types.

This allows us to remove some hack code from
schemas.c:apply_transformation(). It's unclear why that "emergency" code
was needed in the first place; no reproducer notes were given.

Even immediately before it was added, regression tests ran fine
(including xml/regression.sh). We've been unable to reproduce a crash
with current code with either the cts-cli upgrade test (which includes a
transformation using upgrade-2.10.xsl) or the xml/regression.sh test. As
far as we can tell, Pacemaker always strips out text nodes (if they
might exist) before an XML node reaches pcmk__xml_create_patchset().

Closes T151

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

Details

Provenance
nrwahl2Authored on Aug 31 2023, 3:53 PM
Parents
rP423635d7004e: Merge pull request #3223 from clumens/python-tests
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task