andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone

Blame SOURCES/0099-Ticket-48636-Fix-config-validation-check.patch

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