Page 1 of 2

LDAP integration and DNs with * in them

Posted: Fri Nov 18, 2016 9:59 am
by StuartQF
Hi,

I've configured LDAP integration with my domains DN, but all of our users are under OUs with three *** in the name - don't ask me why, I don't understand that decision.
When I attempt to import users, I see the list of OUs but can't view anything beneath the ones with the * characters.
If I change the base DN to an OU with some of my users in it and use the \2A escape character, I can import the users in that OU.

Any chance I'm missing something simple?

I have version 5.3.2 installed, and the LDAP component is version 1.0.6

Re: LDAP integration and DNs with * in them

Posted: Fri Nov 18, 2016 12:46 pm
by dwhitfield
For clarity, you are using LDAP / Active Directory Integration? We are only here until 2PM US Central today, so you have about 2 hours to get me that so I can start digging. Otherwise, maybe a community member will have an answer over the weekend.

Re: LDAP integration and DNs with * in them

Posted: Fri Nov 18, 2016 1:06 pm
by StuartQF
LDAP/AD - That's correct

Re: LDAP integration and DNs with * in them

Posted: Fri Nov 18, 2016 3:07 pm
by dwhitfield
So, I think it's safe to say at this point you aren't missing something simple. Can you show us how you are escaping each of the three *? Also, can you give us the complete OU names? If can't/aren't comfortable with that information being public, can you PM it to me? If you PM it, I'll look at it on Monday. If you post to the thread, a community member might be able to help out.

EDIT: LDAP info received.

Re: LDAP integration and DNs with * in them

Posted: Mon Nov 21, 2016 11:57 am
by StuartQF
PM Sent

Re: LDAP integration and DNs with * in them

Posted: Mon Nov 21, 2016 12:28 pm
by dwhitfield
Those look find to me. Could you PM me your profile? Admin > System Config > System Profile (click "Show Profile" in XI 5 onwards) Thanks!

Same deal with updating the post after you've sent. :)

UPDATE: Profile received and shared with techs.

Re: LDAP integration and DNs with * in them

Posted: Tue Nov 22, 2016 9:07 am
by StuartQF
PM sent with system profile

Re: LDAP integration and DNs with * in them

Posted: Tue Nov 22, 2016 6:02 pm
by ssax
Please edit this file:

Code: Select all

/usr/local/nagiosxi/html/includes/components/ldap_ad_integration/adLDAP/src/classes/adLDAPFolders.php
Around line 122, change this code:

Code: Select all

$filter .= '(!(distinguishedname=' . $ou . ',' . $this->adldap->getBaseDn() . ')))';
To this:

Code: Select all

$filter .= '(!(distinguishedname=' . str_replace("*", "\*", $ou) . ',' . $this->adldap->getBaseDn() . ')))';
Then try it again and let us know if that resolves the issue for you.

Thank you

Re: LDAP integration and DNs with * in them

Posted: Wed Nov 23, 2016 9:16 am
by StuartQF
That worked perfectly!

Thank you!

Re: LDAP integration and DNs with * in them

Posted: Wed Nov 23, 2016 10:45 am
by dwhitfield
It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!