froxlor / Froxlor

The server administration software for your needs - The official Froxlor development Git repository
http://www.froxlor.org
GNU General Public License v2.0
1.62k stars 455 forks source link

Ensure XPath for ConfigDaemon matches exactly one element #1224

Closed z-e-r-0-t closed 7 months ago

z-e-r-0-t commented 7 months ago

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 the name attribute) to match both elements and results in a broken output for service configuration (version from line 1557 is displayed twice).

g_1

Type of change

How Has This Been Tested?