]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: ldap: simple_bind() should set ldap option on tldap 12678/head
authorWeibing Zhang <atheism.zhang@gmail.com>
Thu, 22 Dec 2016 06:38:27 +0000 (14:38 +0800)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Tue, 27 Dec 2016 09:35:02 +0000 (15:05 +0530)
    ldap_set_option() should set option for "tldap" other than "ldap".
    The current code will lead to "Protocol error" as the ldap version
    of tldap is not set.

Signed-off-by: Weibing Zhang <zhangweibing@unitedstack.com>
(cherry picked from commit 96cf7fa06a1192293b24c823ad9d08456f81ac8a)

src/rgw/rgw_ldap.h

index 5d3340663c26c39e5b9ca4d8d8a95797e0fe4cd1..ab84d82b41e5ec3089ab4b8478f6284a5dc3a0cd 100644 (file)
@@ -79,7 +79,7 @@ namespace rgw {
       int ret = ldap_initialize(&tldap, uri.c_str());
       if (ret == LDAP_SUCCESS) {
        unsigned long ldap_ver = LDAP_VERSION3;
-       ret = ldap_set_option(ldap, LDAP_OPT_PROTOCOL_VERSION,
+       ret = ldap_set_option(tldap, LDAP_OPT_PROTOCOL_VERSION,
                              (void*) &ldap_ver);
        if (ret == LDAP_SUCCESS) {
          ret = ldap_simple_bind_s(tldap, dn, pwd.c_str());