diff options
Diffstat (limited to 'modules/extra/m_ldap.cpp')
-rw-r--r-- | modules/extra/m_ldap.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp index 67a433bbd..a2bbcf655 100644 --- a/modules/extra/m_ldap.cpp +++ b/modules/extra/m_ldap.cpp @@ -240,9 +240,13 @@ class LDAPService : public LDAPProvider, public Thread, public Condition for (LDAPMessage *cur = ldap_first_message(this->con, result); cur; cur = ldap_next_message(this->con, cur)) { int cur_type = ldap_msgtype(cur); + char *dn = ldap_get_dn(this->con, cur); LDAPAttributes attributes; + if (dn != NULL) + attributes["dn"].push_back(dn); + switch (cur_type) { case LDAP_RES_BIND: @@ -250,7 +254,6 @@ class LDAPService : public LDAPProvider, public Thread, public Condition break; case LDAP_RES_SEARCH_ENTRY: ldap_result->type = LDAPResult::QUERY_SEARCH; - case LDAP_RES_SEARCH_RESULT: break; case LDAP_RES_ADD: ldap_result->type = LDAPResult::QUERY_ADD; @@ -261,6 +264,8 @@ class LDAPService : public LDAPProvider, public Thread, public Condition case LDAP_RES_MODIFY: ldap_result->type = LDAPResult::QUERY_MODIFY; break; + case LDAP_RES_SEARCH_RESULT: + break; /* Ignore this */ default: Log(LOG_DEBUG) << "m_ldap: Unknown msg type " << cur_type; continue; @@ -316,6 +321,9 @@ class LDAPService : public LDAPProvider, public Thread, public Condition } ldap_result->messages.push_back(attributes); + + if (dn != NULL) + ldap_memfree(dn); } ldap_msgfree(result); |