Re: Update LDAP Protocol in fe-connect.c to v3

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Andrew Jackson <andrewjackson947(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Update LDAP Protocol in fe-connect.c to v3
Date: 2025-04-03 13:32:49
Message-ID: 8b57bad6-d5a3-439c-8f8c-fd2724fff0a0@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 22.03.25 22:22, Andrew Jackson wrote:
> Apologies, forgot to attach the patch in the prior email.
>
> On Sat, Mar 22, 2025 at 4:10 PM Andrew Jackson
> <andrewjackson947(at)gmail(dot)com <mailto:andrewjackson947(at)gmail(dot)com>> wrote:
>
> Currently the LDAP usage in fe-connect.c does not explicitly set the
> protocol version to v3. This causes issues with many LDAP servers as
> they will often require clients to use the v3 protocol and disallow
> any use of the v2 protocol. Further the other usage of LDAP in
> postgres (in `backend/libpq/auth.c`) uses the v3 protocol.
>
> This patch changes fe-connect.c so that it uses the v3 protocol
> similar to `backend/libpq/auth.c`.
>
> One further note is that I do not currently see any test coverage
> over the LDAP functionality in `fe-connect.c`. I am happy to add
> that to this patch if needed.

Here is a slightly polished version of this patch. I added an error
message, and changed the return code, but it's a bit confusing which one
might be the right one.

I also looked over the test file that you sent in a separate message.
That also looks generally ok, but I'm not so deep into LDAP right now
that I can give a detailed review.

My hunch right now is that we should probably take the patch that sets
the version option and consider it for backpatching. The patch with the
tests can be held for detailed review later.

Attachment Content-Type Size
v2-0001-libpq-Set-LDAP-protocol-version-3.patch text/plain 1.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2025-04-03 13:40:49 Re: Test to dump and restore objects left behind by regression
Previous Message Christoph Berg 2025-04-03 13:28:12 Re: Making sslrootcert=system work on Windows psql