On Mon, Dec 3, 2012 at 11:46:56PM -0500, Bruce Momjian wrote:
> On Tue, Dec 4, 2012 at 04:31:51AM +0000, Peter Eisentraut wrote:
> > Add support for LDAP URLs
> >
> > Allow specifying LDAP authentication parameters as RFC 4516 LDAP URLs.
> >
> > Branch
> > ------
> > master
> >
> > Details
> > -------
> > http://git.postgresql.org/pg/commitdiff/aa2fec0a18e4d23272c78916ef318078c920611a
> >
> > Modified Files
> > --------------
> > doc/src/sgml/client-auth.sgml | 37 +++++++++++++++++++++++++
> > src/backend/libpq/auth.c | 2 +-
> > src/backend/libpq/hba.c | 59
> > ++++++++++++++++++++++++++++++++++++++++-
> > src/include/libpq/hba.h | 1 +
> > 4 files changed, 97 insertions(+), 2 deletions(-)
>
> I am seeing this compile error in Debian Squeeze:
>
> hba.c: In function ‘parse_hba_auth_opt’:
> hba.c:1388: error: ‘LDAP_SCOPE_SUBTREE’ undeclared (first use in this
> function)
> hba.c:1388: error: (Each undeclared identifier is reported only once
> hba.c:1388: error: for each function it appears in.)
> hba.c:1451: error: ‘LDAPURLDesc’ undeclared (first use in this function)
> hba.c:1451: error: ‘urldata’ undeclared (first use in this function)
> hba.c:1452: warning: ISO C90 forbids mixed declarations and code
> hba.c:1452: warning: unused variable ‘rc’
> make[3]: *** [hba.o] Error 1
How do you like this attached patch to fix it?
--
Bruce Momjian <[email protected]> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c
new file mode 100644
index 2bb661c..40727a9
*** a/src/backend/libpq/hba.c
--- b/src/backend/libpq/hba.c
*************** parse_hba_line(List *line, int line_num)
*** 1385,1391 ****
--- 1385,1393 ----
static bool
parse_hba_auth_opt(char *name, char *val, HbaLine *hbaline, int line_num)
{
+ #ifdef USE_LDAP
hbaline->ldapscope = LDAP_SCOPE_SUBTREE;
+ #endif
if (strcmp(name, "map") == 0)
{
*************** parse_hba_auth_opt(char *name, char *val
*** 1448,1458 ****
}
else if (strcmp(name, "ldapurl") == 0)
{
LDAPURLDesc *urldata;
int rc;
REQUIRE_AUTH_OPTION(uaLDAP, "ldapurl", "ldap");
-
#ifdef LDAP_API_FEATURE_X_OPENLDAP
rc = ldap_url_parse(val, &urldata);
if (rc != LDAP_SUCCESS)
--- 1450,1461 ----
}
else if (strcmp(name, "ldapurl") == 0)
{
+ #ifdef LDAP_API_FEATURE_X_OPENLDAP
LDAPURLDesc *urldata;
int rc;
+ #endif
REQUIRE_AUTH_OPTION(uaLDAP, "ldapurl", "ldap");
#ifdef LDAP_API_FEATURE_X_OPENLDAP
rc = ldap_url_parse(val, &urldata);
if (rc != LDAP_SUCCESS)
--
Sent via pgsql-committers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers