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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to