Re: support for LDAP URLs

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Robert Haas *EXTERN*" <robertmhaas(at)gmail(dot)com>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: support for LDAP URLs
Date: 2012-11-16 09:36:13
Message-ID: D960CB61B694CF459DCFB4B0128514C208B87B5F@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas wrote:
>> Here is a patch to support RFC 2255 LDAP URLs in pg_hba.conf.

> I think this is broadly reasonable, but I'm not sure this part is a
good idea:
>
> +#ifdef USE_LDAP
> +#ifndef WIN32
> +/* We use a deprecated function to keep the codepath the same as
win32. */
> +#define LDAP_DEPRECATED 1
> +#include <ldap.h>
> +#else
> +#include <winldap.h>
> +#endif
> +#endif
>
> Presumably if it's deprecated now, it might go away without notice,
> and we shouldn't be relying on it to stick around.

I did the same thing in src/interfaces/libpq/fe-connect.c

I think I remember that problem was that OpenLDAP has deprecated
some API functions, and Windows didn't support the replacements.

Both RFC 1823 and the draft
http://tools.ietf.org/html/draft-ietf-ldapext-ldap-c-api-05
(the latest version I found is from 2001) had these functions
as not deprecated, so I figured it was safe to use it.

Moreover, RFC 1823 didn't contain the replacement functions,
so I didn't feel safe to use them.

I just checked, and the only function I could find that is
deprecated in OpenLDAP, but its replacement is not defined
on Windows, is ldap_unbind.

The alternative to using the deprecated functions would be to
write platform dependent macros that do the right thing.
If ldap_unbind really is the only problem, maybe all LDAP code
should be rewritten to avoid LDAP_DEPRECATED.

What do you think?
Do we feel bound to adhere to RFC 1823?

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2012-11-16 09:40:07 Re: Do we need so many hint bits?
Previous Message Cédric Villemain 2012-11-16 08:24:38 Re: Proposal for Allow postgresql.conf values to be changed via SQL