andykimpe / rpms / 389-ds-base

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