Blob Blame History Raw
From d39be97021f273548957a9f26ca35d5faab20318 Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Mon, 29 Jan 2018 21:13:16 -0500
Subject: [PATCH] Ticket 49541 - Replica ID config validation fix

Description:  Is is possible to set the replica ID to 65535 with a modify
              operation, which is reserved for hubs/consumers.

https://pagure.io/389-ds-base/issue/49541

Reviewed by: mreynolds (one line commit rule)
---
 ldap/servers/plugins/replication/repl5_replica_config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c
index bda333362..ea430d9a4 100644
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
@@ -421,7 +421,7 @@ replica_config_modify(Slapi_PBlock *pb,
                     }
                 } else if (strcasecmp(config_attr, attr_replicaId) == 0) {
                     int64_t rid = 0;
-                    if (repl_config_valid_num(config_attr, config_attr_value, 1, 65535, returncode, errortext, &rid) == 0) {
+                    if (repl_config_valid_num(config_attr, config_attr_value, 1, 65534, returncode, errortext, &rid) == 0) {
                         slapi_ch_free_string(&new_repl_id);
                         new_repl_id = slapi_ch_strdup(config_attr_value);
                     } else {
-- 
2.13.6