Add DNS SRV support for LDAP server discovery.

Thomas Munro <tmunro@postgresql.org>

Commit: 0f086f84ad9041888b789af5871c7432f0e19c5b
Author: Thomas Munro <tmunro@postgresql.org>
Date: 2019-03-21T02:28:17Z
Releases: 12.0
Add DNS SRV support for LDAP server discovery.

LDAP servers can be advertised on a network with RFC 2782 DNS SRV
records.  The OpenLDAP command-line tools automatically try to find
servers that way, if no server name is provided by the user.  Teach
PostgreSQL to do the same using OpenLDAP's support functions, when
building with OpenLDAP.

For now, we assume that HAVE_LDAP_INITIALIZE (an OpenLDAP extension
available since OpenLDAP 2.0 and also present in Apple LDAP) implies
that you also have ldap_domain2hostlist() (which arrived in the same
OpenLDAP version and is also present in Apple LDAP).

Author: Thomas Munro
Reviewed-by: Daniel Gustafsson
Discussion: https://postgr.es/m/CAEepm=2hAnSfhdsd6vXsM6VZVN0br-FbAZ-O+Swk18S5HkCP=A@mail.gmail.com

Files

PathChange+/−
doc/src/sgml/client-auth.sgml modified +20 −1
src/backend/libpq/auth.c modified +112 −40
src/backend/libpq/hba.c modified +3 −0

Documentation touched

Discussion