openldap: create ldap URLs correctly for IPv6 addresses
authorDaniel Stenberg <daniel@haxx.se>
Sat, 30 Mar 2024 10:14:54 +0000 (11:14 +0100)
committerSamuel Henrique <samueloph@debian.org>
Mon, 29 Apr 2024 17:28:54 +0000 (18:28 +0100)
commit753b257b1d0a6cadbaec4f09c3e8be509387c4bc
treef98d66c618c303c06b4185cb149e974a4adc59d1
parent44d2c771abc3fc41e70b3004f78c38f3932eb954
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