sandbox: allow supplemental config nodes

Let the sandbox library disregard all unknown config sub nodes so that
supplemental information - like the monitor policy configuration - is
not interpreted as a misconfiguration ("unknown config element type ...").

Issue #4917
This commit is contained in:
Norman Feske 2023-06-06 15:52:53 +02:00
parent add6dbac4e
commit 65f65073e6

View File

@ -21,7 +21,7 @@ struct Config_model::Node : Noncopyable, Interface, private List_model<Node>::El
friend class List_model<Node>;
friend class List<Node>;
static bool type_matches(Xml_node const &) { return true; }
static bool type_matches(Xml_node const &xml);
virtual bool matches(Xml_node const &) const = 0;
@ -304,6 +304,20 @@ struct Config_model::Service_node : Node
};
bool Config_model::Node::type_matches(Xml_node const &xml)
{
return Parent_provides_node::type_matches(xml)
|| Default_route_node ::type_matches(xml)
|| Default_node ::type_matches(xml)
|| Start_node ::type_matches(xml)
|| Affinity_space_node ::type_matches(xml)
|| Report_node ::type_matches(xml)
|| Resource_node ::type_matches(xml)
|| Heartbeat_node ::type_matches(xml)
|| Service_node ::type_matches(xml);
}
void Config_model::update_from_xml(Xml_node const &xml,
Allocator &alloc,
Reconstructible<Verbose> &verbose,