From 96cf7fa06a1192293b24c823ad9d08456f81ac8a Mon Sep 17 00:00:00 2001 From: Weibing Zhang Date: Thu, 22 Dec 2016 14:38:27 +0800 Subject: [PATCH] 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 --- src/rgw/rgw_ldap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/rgw_ldap.h b/src/rgw/rgw_ldap.h index 5d3340663c26c..ab84d82b41e5e 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()); -- 2.39.5