HomeClusterLabs Projects

Fix: libcrmcommon: pcmk__xml_read() recovery works for stdin

Description

Fix: libcrmcommon: pcmk__xml_read() recovery works for stdin

Regression introduced in 2.1.7 by 596297a.

Previously, if pcmk__xml_read() was called with an argument of NULL or
"-", we told libxml2 to read from stdin's file descriptor and parse XML
from it. If this failed, we tried the same thing again.

The problem is that the data from stdin has already been read and
discarded on the first attempt. So the second attempt with
XML_PARSE_RECOVER finds an empty document.

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

Details

Provenance
nrwahl2Authored on Feb 9 2024, 3:43 PM
Parents
rPf5bc32650abf: Low: libcrmcommon: Don't try to parse XML from bad .bz2 file
Branches
Unknown
Tags
Unknown