pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: configure openldap crash warning
Date: Fri, 06 May 2022 14:00:43 -0400
Message-ID: <2957308.1651860043@sss.pgh.pa.us> (raw)
In-Reply-To: <2360302.1651678212@sss.pgh.pa.us>
References: <fedacd7c-2a38-25c9-e7ff-dea549d0e979@enterprisedb.com>
	<1832824.1651500238@sss.pgh.pa.us>
	<f2393be8-2b92-1ee6-0812-324cf7660f24@enterprisedb.com>
	<2358598.1651677372@sss.pgh.pa.us>
	<2360302.1651678212@sss.pgh.pa.us>

I wrote:
> Oh, I have a theory about this: I bet your Homebrew installation
> has a recent OpenLDAP version that only supplies libldap not libldap_r.
> In that case, configure will still find libldap_r available and will
> bind libpq to it, and you get the observed result.  The configure
> check is not sophisticated enough to realize that it's finding chunks
> of two different OpenLDAP installations.

After thinking about this for awhile, it seems like the best solution
is to make configure proceed like this:

1. Find libldap.
2. Detect whether it's OpenLDAP 2.5 or newer.
3. If not, try to find libldap_r.

There are various ways we could perform step 2, but I think the most
reliable is to try to link to some function that's present in 2.5
but not before.  (In particular, this doesn't require any strong
assumptions about whether the installation's header files match the
library.)  After a quick dig in 2.4 and 2.5, it looks like
ldap_verify_credentials() would serve.

Barring objections, I'll make a patch for that.

BTW, I was a little distressed to read this in the 2.4 headers:

    ** If you fail to define LDAP_THREAD_SAFE when linking with
    ** -lldap_r or define LDAP_THREAD_SAFE when linking with -lldap,
    ** provided header definations and declarations may be incorrect.

That's not something we do or ever have done, AFAIK.  Given the
lack of complaints and the fact that 2.4 is more or less EOL,
I don't feel a strong need to worry about it; but it might be
something to keep in mind in case we get bug reports.

			regards, tom lane





view thread (15+ messages)  latest in thread

Message-ID: <2957308.1651860043@sss.pgh.pa.us>
Permalink:  ../2957308.1651860043@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2957308.1651860043@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, peter.eisentraut@enterprisedb.com
  Subject: Re: configure openldap crash warning
  In-Reply-To: <2957308.1651860043@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox