Re: configure openldap crash warning

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: configure openldap crash warning
Дата
Msg-id 2957308.1651860043@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: configure openldap crash warning  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: configure openldap crash warning  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: configure openldap crash warning  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: failures in t/031_recovery_conflict.pl on CI
Следующее
От: Tom Lane
Дата:
Сообщение: Re: failures in t/031_recovery_conflict.pl on CI