centreon-archived icon indicating copy to clipboard operation
centreon-archived copied to clipboard

fix(conf): Sanitize contact group names from illegal characters (#11480)

Open proxyconcept opened this issue 2 years ago • 1 comments

Contact groups name can contains illegal characters when imported from LDAP (sanitize the input is complex due to synchronization process). Therefore illegal characters are removed only when generating nagios configuration files (and so according to the current poller configuration for illegal characters).

Refs: #11480 Signed-off-by: Grégory Marigot [email protected]

Description

Contact groups name can contains illegal characters when imported from LDAP (sanitize the input is complex due to synchronization process). Therefore illegal characters are removed only when generating nagios configuration files (and so according to the current poller configuration for illegal characters).

Fixes #11480

Type of change

  • [x] Patch fixing an issue (non-breaking change)
  • [ ] New functionality (non-breaking change)
  • [ ] Breaking change (patch or feature) that might cause side effects breaking part of the Software

Target serie

  • [ ] 21.04.x
  • [ ] 21.10.x
  • [x] 22.04.x
  • [x] 22.10.x (master)

How this pull request can be tested ?

  1. Have a group in your LDAP server with a name containing a nagios illegal character (by default ~!$%^&*"|'<>?,()=)
  2. Configure the LDAP backend in Centreon (with group support) and synchronize (LDAP groups imported as contact groups)
  3. Edit a host and link for notifications the contact group from LDAP (with illegal chars)
  4. Generate the nagios configuration files for the poller

The generation should be OK and the nagios configuration files must contains the sanitized name for contact groups0

Checklist

Community contributors & Centreon team

  • [x] I have followed the coding style guidelines provided by Centreon
  • [x] I have commented my code, especially new classes, functions or any legacy code modified. (docblock)
  • [x] I have commented my code, especially hard-to-understand areas of the PR.
  • [x] I have rebased my development branch on the base branch (master, maintenance).

proxyconcept avatar Sep 05 '22 11:09 proxyconcept