1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-05 07:41:25 +03:00

Fix build of LDAP URL feature

Some code was not ifdef'ed out for non-LDAP builds.

patch from Bruce Momjian
This commit is contained in:
Peter Eisentraut
2012-12-04 06:41:21 -05:00
parent 5ce108bf32
commit ec8d1e32dd

View File

@@ -1385,7 +1385,9 @@ parse_hba_line(List *line, int line_num)
static bool static bool
parse_hba_auth_opt(char *name, char *val, HbaLine *hbaline, int line_num) parse_hba_auth_opt(char *name, char *val, HbaLine *hbaline, int line_num)
{ {
#ifdef USE_LDAP
hbaline->ldapscope = LDAP_SCOPE_SUBTREE; hbaline->ldapscope = LDAP_SCOPE_SUBTREE;
#endif
if (strcmp(name, "map") == 0) if (strcmp(name, "map") == 0)
{ {
@@ -1448,11 +1450,12 @@ parse_hba_auth_opt(char *name, char *val, HbaLine *hbaline, int line_num)
} }
else if (strcmp(name, "ldapurl") == 0) else if (strcmp(name, "ldapurl") == 0)
{ {
#ifdef LDAP_API_FEATURE_X_OPENLDAP
LDAPURLDesc *urldata; LDAPURLDesc *urldata;
int rc; int rc;
#endif
REQUIRE_AUTH_OPTION(uaLDAP, "ldapurl", "ldap"); REQUIRE_AUTH_OPTION(uaLDAP, "ldapurl", "ldap");
#ifdef LDAP_API_FEATURE_X_OPENLDAP #ifdef LDAP_API_FEATURE_X_OPENLDAP
rc = ldap_url_parse(val, &urldata); rc = ldap_url_parse(val, &urldata);
if (rc != LDAP_SUCCESS) if (rc != LDAP_SUCCESS)