From bb69e8a6937c8790e8a990902280a051c6eb27d7 Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Wed, 18 Feb 2015 16:18:19 -0800 Subject: [PATCH 305/305] Ticket #47965 - Fix coverity issues and compiler warnings - 2014/12/16, 2014/11/24, 2015/2/18 Description: Fixed compiler warnings in dse.c, libglobs.c, log.c, pw.c, and pw_retry.c. --- ldap/servers/slapd/dse.c | 4 ++-- ldap/servers/slapd/libglobs.c | 3 --- ldap/servers/slapd/log.c | 2 -- ldap/servers/slapd/pw.c | 3 --- ldap/servers/slapd/pw_retry.c | 2 +- 5 files changed, 3 insertions(+), 11 deletions(-) diff --git a/ldap/servers/slapd/dse.c b/ldap/servers/slapd/dse.c index efa64ff..22cbff1 100644 --- a/ldap/servers/slapd/dse.c +++ b/ldap/servers/slapd/dse.c @@ -704,9 +704,9 @@ dse_read_one_file(struct dse *pdse, const char *filename, Slapi_PBlock *pb, if ( (NULL != pdse) && (NULL != filename) ) { /* check if the "real" file exists and cam be used, if not try tmp as backup */ - rc = dse_check_file(filename, pdse->dse_tmpfile); + rc = dse_check_file((char *)filename, pdse->dse_tmpfile); if (!rc) - rc = dse_check_file(filename, pdse->dse_fileback); + rc = dse_check_file((char *)filename, pdse->dse_fileback); if ( (rc = PR_GetFileInfo( filename, &prfinfo )) != PR_SUCCESS ) { diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c index 3c0c9f4..825dcee 100644 --- a/ldap/servers/slapd/libglobs.c +++ b/ldap/servers/slapd/libglobs.c @@ -86,9 +86,6 @@ #endif #define REMOVE_CHANGELOG_CMD "remove" -#define DEFAULT_SASL_MAXBUFSIZE "65536" -#define SLAPD_DEFAULT_SASL_MAXBUFSIZE 65536 -#define DEFAULT_DISK_THRESHOLD "2097152" /* On UNIX, there's only one copy of slapd_ldap_debug */ /* On NT, each module keeps its own module_ldap_debug, which */ diff --git a/ldap/servers/slapd/log.c b/ldap/servers/slapd/log.c index c6131fb..3a31260 100644 --- a/ldap/servers/slapd/log.c +++ b/ldap/servers/slapd/log.c @@ -1731,7 +1731,6 @@ slapd_log_audit_proc ( int buf_len) { if ( (loginfo.log_audit_state & LOGGING_ENABLED) && (loginfo.log_audit_file != NULL) ){ - int err; LOG_AUDIT_LOCK_WRITE( ); if (log__needrotation(loginfo.log_audit_fdes, SLAPD_AUDIT_LOG) == LOG_ROTATE) { @@ -4152,7 +4151,6 @@ static void log_flush_buffer(LogBufferInfo *lbi, int type, int sync_now) slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); if (type == SLAPD_ACCESS_LOG) { - int err = 0; /* It is only safe to flush once any other threads which are copying are finished */ while (lbi->refcount > 0) { diff --git a/ldap/servers/slapd/pw.c b/ldap/servers/slapd/pw.c index 73fcfa9..782d1c8 100644 --- a/ldap/servers/slapd/pw.c +++ b/ldap/servers/slapd/pw.c @@ -64,7 +64,6 @@ #include "slap.h" - #define DENY_PW_CHANGE_ACI "(targetattr = \"userPassword\") ( version 3.0; acl \"disallow_pw_change_aci\"; deny (write ) userdn = \"ldap:///self\";)" #define GENERALIZED_TIME_LENGTH 15 @@ -452,7 +451,6 @@ pw_rever_decode(char *cipher, char **plain, const char * attr_name) { if (slapi_attr_types_equivalent(L_attr, attr_name)) { - typedef int (*CMPFP)(char *, char *); typedef char * (*ENCFP)(char *); pwsp = (struct pw_scheme *) slapi_ch_calloc (1, sizeof(struct pw_scheme)); @@ -528,7 +526,6 @@ pw_rever_encode(Slapi_Value **vals, char * attr_name) { if (slapi_attr_types_equivalent(L_attr, attr_name)) { - typedef int (*CMPFP)(char *, char *); typedef char * (*ENCFP)(char *); pwsp = (struct pw_scheme *) slapi_ch_calloc (1, sizeof(struct pw_scheme)); diff --git a/ldap/servers/slapd/pw_retry.c b/ldap/servers/slapd/pw_retry.c index 74e575e..68a6bd9 100644 --- a/ldap/servers/slapd/pw_retry.c +++ b/ldap/servers/slapd/pw_retry.c @@ -221,7 +221,7 @@ Slapi_Entry *get_entry ( Slapi_PBlock *pb, const char *dn) int search_result = 0; Slapi_Entry *retentry = NULL; Slapi_DN *target_sdn = NULL; - char *target_dn = (char *)dn; + const char *target_dn = dn; Slapi_DN sdn; if (pb) { -- 1.9.3