mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 01:18:00 +03:00
security: aa-helper: Use virXMLParse instead of virXMLParseString
Use the helper with more features to validate the root XML element name instead of open-coding it. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
f093022155
commit
82b959ad02
@ -573,13 +573,8 @@ caps_mockup(vahControl * ctl, const char *xmlStr)
|
||||
g_autoptr(xmlXPathContext) ctxt = NULL;
|
||||
char *arch;
|
||||
|
||||
if (!(xml = virXMLParseStringCtxt(xmlStr, _("(domain_definition)"),
|
||||
&ctxt))) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!virXMLNodeNameEqual(ctxt->node, "domain")) {
|
||||
vah_error(NULL, 0, _("unexpected root element, expecting <domain>"));
|
||||
if (!(xml = virXMLParse(NULL, xmlStr, _("(domain_definition)"),
|
||||
"domain", &ctxt, NULL, false))) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user