diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2013-03-10 15:43:51 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2013-03-10 23:14:17 +0100 |
commit | f7c6771538371e4797a29ec6e5a8ea91d955beeb (patch) | |
tree | e6d6f31f6613dcd3512e3b7922ab1fcb9068bb85 | |
parent | ba5f39f7c21cf3444ca2e84b0c02e89a1f36cd66 (diff) |
also support systems without bet_get_enum()
-rw-r--r-- | compat/ldap_parse_passwordpolicy_control.c | 4 | ||||
-rw-r--r-- | configure.ac | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/compat/ldap_parse_passwordpolicy_control.c b/compat/ldap_parse_passwordpolicy_control.c index 88a0d6a..3517085 100644 --- a/compat/ldap_parse_passwordpolicy_control.c +++ b/compat/ldap_parse_passwordpolicy_control.c @@ -52,7 +52,9 @@ int ldap_parse_passwordpolicy_control(LDAP UNUSED(*ld), LDAPControl *ctrl, ber_tag_t tag; ber_len_t berLen; char *last; +#ifdef HAVE_BER_GET_ENUM int err = PP_noError; +#endif /* HAVE_BER_GET_ENUM */ /* get a BerElement from the control */ ber = ber_init(&ctrl->ldctl_value); if (ber == NULL) @@ -86,6 +88,7 @@ int ldap_parse_passwordpolicy_control(LDAP UNUSED(*ld), LDAPControl *ctrl, return LDAP_DECODING_ERROR; } break; +#ifdef HAVE_BER_GET_ENUM case PPOLICY_ERROR: if (ber_get_enum(ber, &err) == LBER_DEFAULT) { @@ -93,6 +96,7 @@ int ldap_parse_passwordpolicy_control(LDAP UNUSED(*ld), LDAPControl *ctrl, return LDAP_DECODING_ERROR; } break; +#endif /* HAVE_BER_GET_ENUM */ default: ber_free(ber, 1); return LDAP_DECODING_ERROR; diff --git a/configure.ac b/configure.ac index 9fcc3ac..31d17e8 100644 --- a/configure.ac +++ b/configure.ac @@ -712,7 +712,7 @@ then AC_CHECK_FUNCS(ldap_get_values ldap_get_values_len ldap_value_free ldap_value_free_len) AC_CHECK_FUNCS(ldap_get_dn ldap_explode_dn ldap_count_values_len) AC_CHECK_FUNCS(ldap_err2string ldap_msgfree ldap_result) - AC_CHECK_FUNCS(ber_bvfree ber_free ber_set_option ldap_modify_ext_s) + AC_CHECK_FUNCS(ber_bvfree ber_free ber_set_option ldap_modify_ext_s ber_get_enum) AC_CHECK_FUNCS(ldap_first_attribute ldap_next_attribute) # replace ldap_create_page_control() and ldap_parse_page_control() |