centreon-archived
centreon-archived copied to clipboard
fix(conf): Sanitize contact group names from illegal characters (#11480)
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 ?
- Have a group in your LDAP server with a name containing a nagios illegal character (by default
~!$%^&*"|'<>?,()=
) - Configure the LDAP backend in Centreon (with group support) and synchronize (LDAP groups imported as contact groups)
- Edit a host and link for notifications the contact group from LDAP (with illegal chars)
- 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).
SonarQube Quality Gate
10 Bugs
0 Vulnerabilities
0 Security Hotspots (
100.0% reviewed)
3344 Code Smells