Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3161bc2

Browse files
author
Commitfest Bot
committed
[CF 5661] v3 - Update LDAP Protocol in fe-connect.c to v3
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/5661 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/CAKK5BkE0wOGWwZpPcVxzN6ozsjpwVRU51svpbbCfEnDZ3Xcq4Q@mail.gmail.com Author(s): Andrew Jackson
2 parents 470273d + e744d84 commit 3161bc2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/interfaces/libpq/fe-connect.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5489,6 +5489,7 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
54895489
*entry;
54905490
struct berval **values;
54915491
LDAP_TIMEVAL time = {PGLDAP_TIMEOUT, 0};
5492+
int ldapversion = LDAP_VERSION3;
54925493

54935494
if ((url = strdup(purl)) == NULL)
54945495
{
@@ -5620,6 +5621,15 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
56205621
return 3;
56215622
}
56225623

5624+
if ((rc = ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &ldapversion)) != LDAP_SUCCESS)
5625+
{
5626+
libpq_append_error(errorMessage, "could not set LDAP protocol version: %s",
5627+
ldap_err2string(rc));
5628+
free(url);
5629+
ldap_unbind(ld);
5630+
return 3;
5631+
}
5632+
56235633
/*
56245634
* Perform an explicit anonymous bind.
56255635
*

0 commit comments

Comments
 (0)