From 0e31ef053389b04e471ae9d0c231ea4d54f7ba0e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 12 May 2004 18:44:27 +0000 Subject: [PATCH] * modules/experimental/util_ldap.c (util_ldap_cache_compare): Fix uninitialized variable warning from gcc -Wall. (util_ldap_set_cache_bytes, util_ldap_post_config): Use correct APR printf format string macros. (util_ldap_set_cert_type): Make static to fix gcc warning. (util_ldap_cleanup_module): Fix unused variable warning. * modules/experimental/mod_auth_ldap.c (derive_codepage_from_lang): Remove unused variable. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103664 13f79535-47bb-0310-9956-ffa450edef68 --- modules/experimental/mod_auth_ldap.c | 1 - modules/experimental/util_ldap.c | 28 +++++++++++++--------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/modules/experimental/mod_auth_ldap.c b/modules/experimental/mod_auth_ldap.c index cf8e14e75e..b2fed9f694 100644 --- a/modules/experimental/mod_auth_ldap.c +++ b/modules/experimental/mod_auth_ldap.c @@ -113,7 +113,6 @@ static char *to_charset = NULL; /* UTF-8 identifier derived from the c static char* derive_codepage_from_lang (apr_pool_t *p, char *language) { int lang_len; - int check_short = 0; char *charset; if (!language) /* our default codepage */ diff --git a/modules/experimental/util_ldap.c b/modules/experimental/util_ldap.c index 147e598bf9..0fc8b533b8 100644 --- a/modules/experimental/util_ldap.c +++ b/modules/experimental/util_ldap.c @@ -617,7 +617,7 @@ LDAP_DECLARE(int) util_ldap_cache_compare(request_rec *r, util_ldap_connection_t util_url_node_t curnode; util_compare_node_t *compare_nodep; util_compare_node_t the_compare_node; - apr_time_t curtime; + apr_time_t curtime = 0; /* silence gcc -Wall */ int failures = 0; util_ldap_state_t *st = @@ -961,8 +961,9 @@ static const char *util_ldap_set_cache_bytes(cmd_parms *cmd, void *dummy, const st->cache_bytes = atol(bytes); ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, cmd->server, - "[%d] ldap cache: Setting shared memory cache size to %d bytes.", - getpid(), st->cache_bytes); + "[%" APR_PID_T_FMT "] ldap cache: Setting shared memory " + " cache size to %" APR_SIZE_T_FMT " bytes.", + getpid(), st->cache_bytes); return NULL; } @@ -1070,7 +1071,7 @@ static const char *util_ldap_set_cert_auth(cmd_parms *cmd, void *dummy, const ch } -const char *util_ldap_set_cert_type(cmd_parms *cmd, void *dummy, const char *Type) +static const char *util_ldap_set_cert_type(cmd_parms *cmd, void *dummy, const char *Type) { util_ldap_state_t *st = (util_ldap_state_t *)ap_get_module_config(cmd->server->module_config, @@ -1118,19 +1119,16 @@ void *util_ldap_create_config(apr_pool_t *p, server_rec *s) static apr_status_t util_ldap_cleanup_module(void *data) { +#if APR_HAS_LDAP_SSL && APR_HAS_NOVELL_LDAPSDK server_rec *s = data; - util_ldap_state_t *st = (util_ldap_state_t *)ap_get_module_config( - s->module_config, &ldap_module); + s->module_config, &ldap_module); + + if (st->ssl_support) + ldapssl_client_deinit(); - #if APR_HAS_LDAP_SSL - #if APR_HAS_NOVELL_LDAPSDK - if (st->ssl_support) - ldapssl_client_deinit(); - #endif - #endif - - return(APR_SUCCESS); +#endif + return APR_SUCCESS; } static int util_ldap_post_config(apr_pool_t *p, apr_pool_t *plog, @@ -1160,7 +1158,7 @@ static int util_ldap_post_config(apr_pool_t *p, apr_pool_t *plog, s_vhost = s->next; while (s_vhost) { ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, result, s, - "LDAP merging Shared Cache conf: shm=0x%x rmm=0x%x for VHOST: %s", + "LDAP merging Shared Cache conf: shm=0x%pp rmm=0x%pp for VHOST: %s", st->cache_shm, st->cache_rmm, s_vhost->server_hostname); st_vhost = (util_ldap_state_t *)ap_get_module_config(s_vhost->module_config, &ldap_module); -- 2.40.0