From: Todd C. Miller Date: Tue, 18 Dec 2007 01:10:10 +0000 (+0000) Subject: fix compilation on Solaris X-Git-Tag: SUDO_1_7_0~302 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3be9fcbedbf60622b69034ee2524fffac46f22e6;p=sudo fix compilation on Solaris --- diff --git a/ldap.c b/ldap.c index ce80ef6a5..74e62d403 100644 --- a/ldap.c +++ b/ldap.c @@ -143,13 +143,15 @@ struct ldap_config { } ldap_conf; struct ldap_config_table ldap_conf_table[] = { - { "debug", CONF_INT, FALSE, LDAP_OPT_DEBUG_LEVEL, &ldap_conf.ldap_debug }, { "sudoers_debug", CONF_INT, FALSE, -1, &ldap_conf.debug }, { "host", CONF_STR, FALSE, -1, &ldap_conf.host }, { "port", CONF_INT, FALSE, -1, &ldap_conf.port }, { "ssl", CONF_STR, FALSE, -1, &ldap_conf.ssl }, { "sslpath", CONF_STR, FALSE, -1, &ldap_conf.sslpath }, { "uri", CONF_STR, FALSE, -1, &ldap_conf.uri }, +#ifdef LDAP_OPT_DEBUG_LEVEL + { "debug", CONF_INT, FALSE, LDAP_OPT_DEBUG_LEVEL, &ldap_conf.ldap_debug }, +#endif #ifdef LDAP_OPT_PROTOCOL_VERSION { "ldap_version", CONF_INT, TRUE, LDAP_OPT_PROTOCOL_VERSION, &ldap_conf.version }, @@ -1041,8 +1043,10 @@ sudo_ldap_set_options(ld) int rc; /* Set ber options */ +#ifdef LBER_OPT_DEBUG_LEVEL if (ldap_conf.ldap_debug) ber_set_option(NULL, LBER_OPT_DEBUG_LEVEL, &ldap_conf.ldap_debug); +#endif /* Set simple LDAP options */ for (cur = ldap_conf_table; cur->conf_str != NULL; cur++) { @@ -1173,11 +1177,13 @@ sudo_ldap_open() warningx("ldapssl_install_routines(): %s", ldapssl_err2string(rc)); return(NULL); } +# ifdef LDAP_OPT_SSL rc = ldap_set_option(ld, LDAP_OPT_SSL, LDAP_OPT_ON); if (rc != LDAP_SUCCESS) { warningx("unable to enable SSL: %s", ldapssl_err2string(rc)); return(NULL); } +# endif } #endif #ifdef HAVE_LDAP_START_TLS_S