andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
dc8c34
From c2e2b0391e2b36c91c983b6948355c833108424d Mon Sep 17 00:00:00 2001
dc8c34
From: Mark Reynolds <mreynolds@redhat.com>
dc8c34
Date: Tue, 14 Jun 2016 17:19:48 -0400
dc8c34
Subject: [PATCH 384/386] Ticket 48636 - Fix config validation check
dc8c34
dc8c34
Bug Description: We were previous checking if an unsigfned int was less than zero
dc8c34
dc8c34
Fix Description:  Improve config validation by using long instead of PRUint64
dc8c34
dc8c34
https://fedorahosted.org/389/ticket/48636
dc8c34
dc8c34
Reviewed by: nhosoi(Thanks!)
dc8c34
dc8c34
(cherry picked from commit 43d5ac680f7781f95205db94e5ff2958d39b78a4)
dc8c34
(cherry picked from commit c66ba8cb24c35d186b14f169e9206269067891a0)
dc8c34
(cherry picked from commit 0c3f203dc72932c827b340289ac1592dae78d188)
dc8c34
(cherry picked from commit a81ca80a9d0fe07274ef71e1cfde7599f277b25f)
dc8c34
---
dc8c34
 ldap/servers/plugins/replication/repl5_replica_config.c | 13 ++++++++-----
dc8c34
 1 file changed, 8 insertions(+), 5 deletions(-)
dc8c34
dc8c34
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c
dc8c34
index f8db8e8..a1dceae 100644
dc8c34
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
dc8c34
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
dc8c34
@@ -497,17 +497,20 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry*
dc8c34
                 {
dc8c34
                     if (apply_mods)
dc8c34
                     {
dc8c34
-                        PRUint64 val = atoll(config_attr_value);
dc8c34
+                        long val = atol(config_attr_value);
dc8c34
 
dc8c34
-                        if(val < 0){
dc8c34
+                        if (val < 0){
dc8c34
                             *returncode = LDAP_UNWILLING_TO_PERFORM;
dc8c34
-                            PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE,
dc8c34
+                            PR_snprintf(errortext, SLAPI_DSE_RETURNTEXT_SIZE,
dc8c34
                                     "attribute %s value (%s) is invalid, must be a number zero or greater.\n",
dc8c34
                                     config_attr, config_attr_value);
dc8c34
-                            slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "replica_config_modify: %s\n", errortext);
dc8c34
+                            slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
dc8c34
+                                            "replica_config_modify: %s\n", errortext);
dc8c34
                             break;
dc8c34
+                        } else {
dc8c34
+                            /* Set the timeout */
dc8c34
+                            replica_set_release_timeout(r, val);
dc8c34
                         }
dc8c34
-                        replica_set_release_timeout(r, val);
dc8c34
                     }
dc8c34
                 }
dc8c34
                 else
dc8c34
-- 
dc8c34
2.4.11
dc8c34