-
Notifications
You must be signed in to change notification settings - Fork 240
Problem with LDAP autoimport and groupmapping with comma in CN #4867
Comments
About your problem with LDAP, we can help you with a patch but we cant implement it in the master branch. |
Same problem here... We have the problem, that users which contains a comma do not work properly. I had a look into the patch, but it just removed the escaping inside the database queries which is not optimal. I can unterstand why you don't want to add it to the master branch ;-) Isn't there a way to add a suitable fix to the master branch? Otherwise every update will override it. Thanks in advance :) |
Hi, We don't want to include this patch because the comma is a reserved character for distinguished names. This patch is a workaround and not a correct solution. https://msdn.microsoft.com/en-us/library/aa366101(v=vs.85).aspx |
Hi, thanks for the patch and the MSDN URL. |
Hi, I gave the problem some thought and further debugging. I'm a bit uncertain about the results: At first I did a ldapsearch with standard ldap utilities on the user:
Mmh the comma in the DN is escaped. Ok I deleted the user and let create it with the autoimporter. Same login problems as expected, so again I looked into the database: So the manual ldap importer and the "auto magic" have different behaviour. Might still be a bug in the auto importer? If you need more information or access to a testing system let me know. |
Thank you for your feedback, we will correct auto-import to add \ |
SQL error reproduced in 2.8.12-6. |
BUG REPORT INFORMATION
Centreon Web version: 2.8.2
Centreon Engine version: 1.6.2
Centreon Broker version: 3.0.3
OS: CES 3.4
Steps to reproduce the issue:
1.Create a user with a comma in the CN in LDAP/ActiveDirectory
2.Configure LDAP connector with autoimport
3.Map LDAP-Group to an ACL
4.Try to login
Describe the results you received:
When you try to login the following error shows up in sql-error.log:
It seems that this code in centreonAuth.LDAP.class.php is at least one of the problems:
The first $userDn variable is not escaped, but the second is.
This results in different values in both queries:
So the secondary query will not get a contact_id and there is no entry in contactgroup_contact_relation table written (later in the code).
At first we tested with Centreon 2.7.x. The error is the same, but after a while the group mapping is written to the table (the ACL Cronjob I think).
With Centreon 2.8.2:
-We can only login one time, after that we get "doesn't match with password" in login.log. Login is possible if we activate "Store LDAP password" in the LDAP connector
-The group mapping will not get written, doesn't matter how long we wait
We tried to fix it by removing the escaping in the second query. The mapping is written, but will be deleted again by the ACL Cronjob or a new login.
Describe the results you expected:
Successful login and mapping of ldap contactgroup to the user.
The text was updated successfully, but these errors were encountered: