From: Weibing Zhang Date: Thu, 22 Dec 2016 06:38:27 +0000 (+0800) Subject: rgw: ldap: simple_bind() should set ldap option on tldap X-Git-Tag: v12.0.0~391^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F12616%2Fhead;p=ceph.git rgw: ldap: simple_bind() should set ldap option on tldap 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 --- diff --git a/src/rgw/rgw_ldap.h b/src/rgw/rgw_ldap.h index 5d3340663c26..ab84d82b41e5 100644 --- a/src/rgw/rgw_ldap.h +++ b/src/rgw/rgw_ldap.h @@ -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());