openldap: create ldap URLs correctly for IPv6 addresses
authorDaniel Stenberg <daniel@haxx.se>
Sat, 30 Mar 2024 10:14:54 +0000 (11:14 +0100)
committerAquila Macedo Costa <aquilamacedo@riseup.net>
Tue, 17 Sep 2024 19:29:24 +0000 (16:29 -0300)
commitf19052eb67cd43173364bd1115549fdb875daa77
treee897cc6d40e5f1abb6b66f1964a221c554d418ec
parent41b30f719cdcfd4141ae623e928ac0dc45cd82a6
openldap: create ldap URLs correctly for IPv6 addresses

Reported-by: Sergio Durigan Junior
Fixes #13228
Closes #13235

More context:

When the user specified an IPv6 address to be used as an LDAP server,
curl will fail to properly enclose it in square brackets, which causes
the connection to fail because the host address cannot be
distinguished from the port:

$ curl -v ldap://[fd42:be5:e632:a6b3:216:3eff:feb1:5bc4]:389
...
* LDAP local: Cannot connect to ldap://fd42:be5:e632:a6b3:216:3eff:feb1:5bc4:389, Bad parameter to an ldap routine
...

Fix this by always enclosing the IPv6 address in square brackets.

Origin: upstream, https://github.com/curl/curl/commit/56935a7dada6975d5a46aa494de0af195e4e8659
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1053643

Gbp-Pq: Name openldap-create-ldap-URLs-correctly-for-IPv6-addresses.patch
lib/openldap.c