1
0
mirror of https://github.com/Yubico/yubico-pam.git synced 2025-02-01 01:52:17 +01:00

Use LDAPv3 instead of LDAPv2.

LDAPv2 was declared historical in 2003, and is now not supported by
for example Mac OS X Server's Open Directory.
Patch by maxsanna81@gmail.com.
This commit is contained in:
Fredrik Thulin 2011-03-03 10:31:30 +01:00
parent 90a7fd0f0a
commit 01897ebb9e

View File

@ -220,6 +220,7 @@ authorize_user_token_ldap (const char *ldap_uri,
D(("called"));
int retval = 0;
int protocol;
#ifdef HAVE_LIBLDAP
LDAP *ld;
LDAPMessage *result, *e;
@ -272,6 +273,10 @@ authorize_user_token_ldap (const char *ldap_uri,
}
}
/* LDAPv2 is historical -- RFC3494. */
protocol = LDAP_VERSION3;
ldap_set_option (ld, LDAP_OPT_PROTOCOL_VERSION, &protocol);
/* Bind anonymously to the LDAP server. */
rc = ldap_simple_bind_s (ld, NULL, NULL);
if (rc != LDAP_SUCCESS)