ldap / AD integration causing crash in 2.2.7

Started by scomoletti, July 24, 2018, 09:44:53 PM

Previous topic - Next topic

scomoletti

I have a new install of 2.2.7 which I'm attempting to get working with my older MS 2008R2 AD server.

With the original source it would successfully connect and retrieve all the objects, adds all users and updates them. It failed all groups with:
netxms:2018.07.23 16:24:11.188 *D* LDAPConnection::fillLists(): Found dn: CN=Admins,OU=Groups,DC=MY,DC=COMPANY,DC=COM
netxms:2018.07.23 16:24:11.188 *D* LDAPConnection::fillLists(): Unknown object is not added: dn: CN=Admins,OU=Groups,DC=MY,DC=COMPANY,DC=COM, login name: (null), full name: (null), description: (null)

I noticed that line 619 of ldap.cpp was checking if objectClass matches LdapGroupClass from the server config but also if it had m_loginName defined.. This seemed off to me.. groups have no loginname attribute.. at least in my AD. I removed that check and it did add the groups but crashes the entire application before it reaches UpdateLDAPGroup in userdb.cpp I belive.. still digging through that. It does update users but never reaches the groups. The total number of users added and updated are roughly what I expected for my server.

The crash logs are:
Jul 24 17:13:18 netxms-test kernel: $MAIN/WRK[19997]: segfault at 0 ip 00007f93a0e3aec4 sp 00007f93944cab18 error 4 in libnetxms.so.2.0.0[7f93a0dec000+6c000]
Jul 24 17:13:18 netxms-test systemd: netxmsd.service: main process exited, code=killed, status=11/SEGV
Jul 24 17:13:18 netxms-test systemd: Unit netxmsd.service entered failed state.
Jul 24 17:13:18 netxms-test systemd: netxmsd.service failed.

So now the question.. does anyone have LDAP working to a MS 2008R2 AD server with 2.2.4+?

scomoletti

Update.. seems the server config item 'LdapMappingName' is used for m_loginName. I was using 'mail' for the value not realizing at first that it was checking this against the groups too. Once I reverted to the original code and recompiled then set LdapMappingName  to 'name' everything worked. I do however want my users to login with their email address.. Is this now an enhancement request for 2.2.8?