The second version in line 1705 is missing the version attribute. This causes the XPath (based only on the name attribute) to match both elements and results in a broken output for service configuration (version from line 1557 is displayed twice).
Type of change
[X] Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
dc220b7a8e5f2237effe2f496a35d68a248030fc causes exception when using Gentoo as expected because of non unique XPath
dc220b7a8e5f2237effe2f496a35d68a248030fc + b55071aeac4cd82ffe4e435cdf7fb409e2291255 fixes the problem when using Gentoo
manually checked other distro XMLs for duplicated name attributes for daemons -> none found -> only Gentoo affected
Description
ConfigDaemon always uses the first matched element from specified XPath https://github.com/Froxlor/Froxlor/blob/87409473231f7f928ae36bff02362a7e034b9e4f/lib/Froxlor/Config/ConfigDaemon.php#L94 but didn't check if specified XPath matched exactly one element.
The Gentoo config XML has two different versions for the daemon
postfix_dovecot
specified:The second version in line 1705 is missing the
version
attribute. This causes the XPath (based only on thename
attribute) to match both elements and results in a broken output for service configuration (version from line 1557 is displayed twice).Type of change
How Has This Been Tested?
name
attributes for daemons -> none found -> only Gentoo affected