Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure XPath for ConfigDaemon matches exactly one element #1224

Merged
merged 2 commits into from
Jan 13, 2024

Conversation

z-e-r-0-t
Copy link
Contributor

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

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • dc220b7 causes exception when using Gentoo as expected because of non unique XPath
  • dc220b7 + b55071a fixes the problem when using Gentoo
    g_2
  • manually checked other distro XMLs for duplicated name attributes for daemons -> none found -> only Gentoo affected

@d00p d00p merged commit 854c930 into froxlor:main Jan 13, 2024
9 checks passed
@z-e-r-0-t z-e-r-0-t deleted the gentoo_postfix_config branch January 13, 2024 11:42
z-e-r-0-t added a commit to z-e-r-0-t/Froxlor that referenced this pull request Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants