|
|
232633 |
From 62af3beb9b2a3137a76456f534db7be1b172210c Mon Sep 17 00:00:00 2001
|
|
|
232633 |
From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Hon=C4=9Bk?= <mhonek@redhat.com>
|
|
|
232633 |
Date: Wed, 16 Jan 2019 09:49:28 +0100
|
|
|
232633 |
Subject: [PATCH] Issue 50474 - Unify result codes for add and modify of repl5
|
|
|
232633 |
config
|
|
|
232633 |
|
|
|
232633 |
Bug Description:
|
|
|
232633 |
Same constraints resulting in error are reported as different LDAP
|
|
|
232633 |
result codes when using different operation for adjusting these.
|
|
|
232633 |
|
|
|
232633 |
Fix Description:
|
|
|
232633 |
A part of the code had not conveyed the error reason down the stack,
|
|
|
232633 |
therefore adding this information and returning the proper code.
|
|
|
232633 |
|
|
|
232633 |
Fixes: https://pagure.io/389-ds-base/issue/50474
|
|
|
232633 |
|
|
|
232633 |
Author: Matus Honek <mhonek@redhat.com>
|
|
|
232633 |
|
|
|
232633 |
Review by: mreynolds, spichugi (thanks!)
|
|
|
232633 |
---
|
|
|
232633 |
.../suites/replication/replica_config_test.py | 25 +++++--
|
|
|
232633 |
ldap/servers/plugins/replication/repl5.h | 2 +-
|
|
|
232633 |
.../plugins/replication/repl5_replica.c | 71 +++++++++++--------
|
|
|
232633 |
.../replication/repl5_replica_config.c | 3 +-
|
|
|
232633 |
4 files changed, 63 insertions(+), 38 deletions(-)
|
|
|
232633 |
|
|
|
232633 |
diff --git a/dirsrvtests/tests/suites/replication/replica_config_test.py b/dirsrvtests/tests/suites/replication/replica_config_test.py
|
|
|
232633 |
index 9a0e1b41f..3dc03713a 100644
|
|
|
232633 |
--- a/dirsrvtests/tests/suites/replication/replica_config_test.py
|
|
|
232633 |
+++ b/dirsrvtests/tests/suites/replication/replica_config_test.py
|
|
|
232633 |
@@ -4,7 +4,6 @@ import copy
|
|
|
232633 |
import os
|
|
|
232633 |
import ldap
|
|
|
232633 |
from lib389._constants import *
|
|
|
232633 |
-from lib389 import Entry
|
|
|
232633 |
from lib389.topologies import topology_st as topo
|
|
|
232633 |
|
|
|
232633 |
from lib389.replica import Replicas
|
|
|
232633 |
@@ -104,12 +103,14 @@ def agmt_setup(topo):
|
|
|
232633 |
def perform_invalid_create(many, properties, attr, value):
|
|
|
232633 |
my_properties = copy.deepcopy(properties)
|
|
|
232633 |
my_properties[attr] = value
|
|
|
232633 |
- with pytest.raises(ldap.LDAPError):
|
|
|
232633 |
+ with pytest.raises(ldap.LDAPError) as ei:
|
|
|
232633 |
many.create(properties=my_properties)
|
|
|
232633 |
+ return ei.value
|
|
|
232633 |
|
|
|
232633 |
def perform_invalid_modify(o, attr, value):
|
|
|
232633 |
- with pytest.raises(ldap.LDAPError):
|
|
|
232633 |
+ with pytest.raises(ldap.LDAPError) as ei:
|
|
|
232633 |
o.replace(attr, value)
|
|
|
232633 |
+ return ei.value
|
|
|
232633 |
|
|
|
232633 |
@pytest.mark.parametrize("attr, too_small, too_big, overflow, notnum, valid", repl_add_attrs)
|
|
|
232633 |
def test_replica_num_add(topo, attr, too_small, too_big, overflow, notnum, valid):
|
|
|
232633 |
@@ -254,9 +255,25 @@ def test_agmt_num_modify(topo, attr, too_small, too_big, overflow, notnum, valid
|
|
|
232633 |
# Value is valid
|
|
|
232633 |
agmt.replace(attr, valid)
|
|
|
232633 |
|
|
|
232633 |
+
|
|
|
232633 |
+@pytest.mark.bz1546739
|
|
|
232633 |
+def test_same_attr_yields_same_return_code(topo):
|
|
|
232633 |
+ """Test that various operations with same incorrect attribute value yield same return code
|
|
|
232633 |
+ """
|
|
|
232633 |
+ attr = 'nsDS5ReplicaId'
|
|
|
232633 |
+
|
|
|
232633 |
+ replica_reset(topo)
|
|
|
232633 |
+ replicas = Replicas(topo.standalone)
|
|
|
232633 |
+ e = perform_invalid_create(replicas, replica_dict, attr, too_big)
|
|
|
232633 |
+ assert type(e) is ldap.UNWILLING_TO_PERFORM
|
|
|
232633 |
+
|
|
|
232633 |
+ replica = replica_setup(topo)
|
|
|
232633 |
+ e = perform_invalid_modify(replica, attr, too_big)
|
|
|
232633 |
+ assert type(e) is ldap.UNWILLING_TO_PERFORM
|
|
|
232633 |
+
|
|
|
232633 |
+
|
|
|
232633 |
if __name__ == '__main__':
|
|
|
232633 |
# Run isolated
|
|
|
232633 |
# -s for DEBUG mode
|
|
|
232633 |
CURRENT_FILE = os.path.realpath(__file__)
|
|
|
232633 |
pytest.main(["-s", CURRENT_FILE])
|
|
|
232633 |
-
|
|
|
232633 |
diff --git a/ldap/servers/plugins/replication/repl5.h b/ldap/servers/plugins/replication/repl5.h
|
|
|
232633 |
index 138578d5f..1801a333e 100644
|
|
|
232633 |
--- a/ldap/servers/plugins/replication/repl5.h
|
|
|
232633 |
+++ b/ldap/servers/plugins/replication/repl5.h
|
|
|
232633 |
@@ -662,7 +662,7 @@ Replica *replica_new(const Slapi_DN *root);
|
|
|
232633 |
Replica *windows_replica_new(const Slapi_DN *root);
|
|
|
232633 |
/* this function should be called to construct the replica object
|
|
|
232633 |
during addition of the replica over LDAP */
|
|
|
232633 |
-Replica *replica_new_from_entry(Slapi_Entry *e, char *errortext, PRBool is_add_operation);
|
|
|
232633 |
+int replica_new_from_entry(Slapi_Entry *e, char *errortext, PRBool is_add_operation, Replica **r);
|
|
|
232633 |
void replica_destroy(void **arg);
|
|
|
232633 |
int replica_subentry_update(Slapi_DN *repl_root, ReplicaId rid);
|
|
|
232633 |
int replica_subentry_check(Slapi_DN *repl_root, ReplicaId rid);
|
|
|
232633 |
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
|
|
|
232633 |
index 6a5363e43..b3f03d5c0 100644
|
|
|
232633 |
--- a/ldap/servers/plugins/replication/repl5_replica.c
|
|
|
232633 |
+++ b/ldap/servers/plugins/replication/repl5_replica.c
|
|
|
232633 |
@@ -128,8 +128,9 @@ replica_new(const Slapi_DN *root)
|
|
|
232633 |
e = _replica_get_config_entry(root, NULL);
|
|
|
232633 |
if (e) {
|
|
|
232633 |
errorbuf[0] = '\0';
|
|
|
232633 |
- r = replica_new_from_entry(e, errorbuf,
|
|
|
232633 |
- PR_FALSE /* not a newly added entry */);
|
|
|
232633 |
+ replica_new_from_entry(e, errorbuf,
|
|
|
232633 |
+ PR_FALSE, /* not a newly added entry */
|
|
|
232633 |
+ &r);
|
|
|
232633 |
|
|
|
232633 |
if (NULL == r) {
|
|
|
232633 |
slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "replica_new - "
|
|
|
232633 |
@@ -143,17 +144,17 @@ replica_new(const Slapi_DN *root)
|
|
|
232633 |
}
|
|
|
232633 |
|
|
|
232633 |
/* constructs the replica object from the newly added entry */
|
|
|
232633 |
-Replica *
|
|
|
232633 |
-replica_new_from_entry(Slapi_Entry *e, char *errortext, PRBool is_add_operation)
|
|
|
232633 |
+int
|
|
|
232633 |
+replica_new_from_entry(Slapi_Entry *e, char *errortext, PRBool is_add_operation, Replica **rp)
|
|
|
232633 |
{
|
|
|
232633 |
- int rc = 0;
|
|
|
232633 |
Replica *r;
|
|
|
232633 |
+ int rc = LDAP_SUCCESS;
|
|
|
232633 |
|
|
|
232633 |
if (e == NULL) {
|
|
|
232633 |
if (NULL != errortext) {
|
|
|
232633 |
PR_snprintf(errortext, SLAPI_DSE_RETURNTEXT_SIZE, "NULL entry");
|
|
|
232633 |
}
|
|
|
232633 |
- return NULL;
|
|
|
232633 |
+ return LDAP_OTHER;
|
|
|
232633 |
}
|
|
|
232633 |
|
|
|
232633 |
r = (Replica *)slapi_ch_calloc(1, sizeof(Replica));
|
|
|
232633 |
@@ -162,7 +163,7 @@ replica_new_from_entry(Slapi_Entry *e, char *errortext, PRBool is_add_operation)
|
|
|
232633 |
if (NULL != errortext) {
|
|
|
232633 |
PR_snprintf(errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Out of memory");
|
|
|
232633 |
}
|
|
|
232633 |
- rc = -1;
|
|
|
232633 |
+ rc = LDAP_OTHER;
|
|
|
232633 |
goto done;
|
|
|
232633 |
}
|
|
|
232633 |
|
|
|
232633 |
@@ -170,7 +171,7 @@ replica_new_from_entry(Slapi_Entry *e, char *errortext, PRBool is_add_operation)
|
|
|
232633 |
if (NULL != errortext) {
|
|
|
232633 |
PR_snprintf(errortext, SLAPI_DSE_RETURNTEXT_SIZE, "failed to create replica lock");
|
|
|
232633 |
}
|
|
|
232633 |
- rc = -1;
|
|
|
232633 |
+ rc = LDAP_OTHER;
|
|
|
232633 |
goto done;
|
|
|
232633 |
}
|
|
|
232633 |
|
|
|
232633 |
@@ -178,7 +179,7 @@ replica_new_from_entry(Slapi_Entry *e, char *errortext, PRBool is_add_operation)
|
|
|
232633 |
if (NULL != errortext) {
|
|
|
232633 |
PR_snprintf(errortext, SLAPI_DSE_RETURNTEXT_SIZE, "failed to create replica lock");
|
|
|
232633 |
}
|
|
|
232633 |
- rc = -1;
|
|
|
232633 |
+ rc = LDAP_OTHER;
|
|
|
232633 |
goto done;
|
|
|
232633 |
}
|
|
|
232633 |
|
|
|
232633 |
@@ -191,14 +192,17 @@ replica_new_from_entry(Slapi_Entry *e, char *errortext, PRBool is_add_operation)
|
|
|
232633 |
|
|
|
232633 |
/* read parameters from the replica config entry */
|
|
|
232633 |
rc = _replica_init_from_config(r, e, errortext);
|
|
|
232633 |
- if (rc != 0) {
|
|
|
232633 |
+ if (rc != LDAP_SUCCESS) {
|
|
|
232633 |
goto done;
|
|
|
232633 |
}
|
|
|
232633 |
|
|
|
232633 |
/* configure ruv */
|
|
|
232633 |
rc = _replica_configure_ruv(r, PR_FALSE);
|
|
|
232633 |
if (rc != 0) {
|
|
|
232633 |
+ rc = LDAP_OTHER;
|
|
|
232633 |
goto done;
|
|
|
232633 |
+ } else {
|
|
|
232633 |
+ rc = LDAP_SUCCESS;
|
|
|
232633 |
}
|
|
|
232633 |
|
|
|
232633 |
/* If smallest csn exists in RUV for our local replica, it's ok to begin iteration */
|
|
|
232633 |
@@ -217,8 +221,12 @@ replica_new_from_entry(Slapi_Entry *e, char *errortext, PRBool is_add_operation)
|
|
|
232633 |
* (done by the update state event scheduled below)
|
|
|
232633 |
*/
|
|
|
232633 |
}
|
|
|
232633 |
- if (rc != 0)
|
|
|
232633 |
+ if (rc != 0) {
|
|
|
232633 |
+ rc = LDAP_OTHER;
|
|
|
232633 |
goto done;
|
|
|
232633 |
+ } else {
|
|
|
232633 |
+ rc = LDAP_SUCCESS;
|
|
|
232633 |
+ }
|
|
|
232633 |
|
|
|
232633 |
/* ONREPL - the state update can occur before the entry is added to the DIT.
|
|
|
232633 |
In that case the updated would fail but nothing bad would happen. The next
|
|
|
232633 |
@@ -237,11 +245,12 @@ replica_new_from_entry(Slapi_Entry *e, char *errortext, PRBool is_add_operation)
|
|
|
232633 |
}
|
|
|
232633 |
|
|
|
232633 |
done:
|
|
|
232633 |
- if (rc != 0 && r) {
|
|
|
232633 |
+ if (rc != LDAP_SUCCESS && r) {
|
|
|
232633 |
replica_destroy((void **)&r);
|
|
|
232633 |
}
|
|
|
232633 |
|
|
|
232633 |
- return r;
|
|
|
232633 |
+ *rp = r;
|
|
|
232633 |
+ return rc;
|
|
|
232633 |
}
|
|
|
232633 |
|
|
|
232633 |
|
|
|
232633 |
@@ -1789,9 +1798,9 @@ _replica_check_validity(const Replica *r)
|
|
|
232633 |
|
|
|
232633 |
if (r->repl_root == NULL || r->repl_type == 0 || r->repl_rid == 0 ||
|
|
|
232633 |
r->repl_csngen == NULL || r->repl_name == NULL) {
|
|
|
232633 |
- return -1;
|
|
|
232633 |
+ return LDAP_OTHER;
|
|
|
232633 |
} else {
|
|
|
232633 |
- return 0;
|
|
|
232633 |
+ return LDAP_SUCCESS;
|
|
|
232633 |
}
|
|
|
232633 |
}
|
|
|
232633 |
|
|
|
232633 |
@@ -1841,7 +1850,7 @@ _replica_init_from_config(Replica *r, Slapi_Entry *e, char *errortext)
|
|
|
232633 |
(char *)slapi_entry_get_dn((Slapi_Entry *)e));
|
|
|
232633 |
slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_init_from_config - %s\n",
|
|
|
232633 |
errormsg);
|
|
|
232633 |
- return -1;
|
|
|
232633 |
+ return LDAP_OTHER;
|
|
|
232633 |
}
|
|
|
232633 |
|
|
|
232633 |
r->repl_root = slapi_sdn_new_dn_passin(val);
|
|
|
232633 |
@@ -1851,7 +1860,7 @@ _replica_init_from_config(Replica *r, Slapi_Entry *e, char *errortext)
|
|
|
232633 |
if ((val = slapi_entry_attr_get_charptr(e, attr_replicaType))) {
|
|
|
232633 |
if (repl_config_valid_num(attr_replicaType, val, 0, REPLICA_TYPE_UPDATABLE, &rc, errormsg, &rtype) != 0) {
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
- return -1;
|
|
|
232633 |
+ return LDAP_UNWILLING_TO_PERFORM;
|
|
|
232633 |
}
|
|
|
232633 |
r->repl_type = rtype;
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
@@ -1867,7 +1876,7 @@ _replica_init_from_config(Replica *r, Slapi_Entry *e, char *errortext)
|
|
|
232633 |
if ((val = slapi_entry_attr_get_charptr(e, type_replicaBackoffMin))) {
|
|
|
232633 |
if (repl_config_valid_num(type_replicaBackoffMin, val, 1, INT_MAX, &rc, errormsg, &backoff_min) != 0) {
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
- return -1;
|
|
|
232633 |
+ return LDAP_UNWILLING_TO_PERFORM;
|
|
|
232633 |
}
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
} else {
|
|
|
232633 |
@@ -1882,7 +1891,7 @@ _replica_init_from_config(Replica *r, Slapi_Entry *e, char *errortext)
|
|
|
232633 |
if ((val = slapi_entry_attr_get_charptr(e, type_replicaBackoffMax))) {
|
|
|
232633 |
if (repl_config_valid_num(type_replicaBackoffMax, val, 1, INT_MAX, &rc, errormsg, &backoff_max) != 0) {
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
- return -1;
|
|
|
232633 |
+ return LDAP_UNWILLING_TO_PERFORM;
|
|
|
232633 |
}
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
} else {
|
|
|
232633 |
@@ -1899,7 +1908,7 @@ _replica_init_from_config(Replica *r, Slapi_Entry *e, char *errortext)
|
|
|
232633 |
backoff_min, backoff_max);
|
|
|
232633 |
slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_init_from_config - "
|
|
|
232633 |
"%s\n", errormsg);
|
|
|
232633 |
- return -1;
|
|
|
232633 |
+ return LDAP_UNWILLING_TO_PERFORM;
|
|
|
232633 |
} else {
|
|
|
232633 |
slapi_counter_set_value(r->backoff_min, backoff_min);
|
|
|
232633 |
slapi_counter_set_value(r->backoff_max, backoff_max);
|
|
|
232633 |
@@ -1910,7 +1919,7 @@ _replica_init_from_config(Replica *r, Slapi_Entry *e, char *errortext)
|
|
|
232633 |
if ((val = slapi_entry_attr_get_charptr(e, type_replicaProtocolTimeout))) {
|
|
|
232633 |
if (repl_config_valid_num(type_replicaProtocolTimeout, val, 0, INT_MAX, &rc, errormsg, &ptimeout) != 0) {
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
- return -1;
|
|
|
232633 |
+ return LDAP_UNWILLING_TO_PERFORM;
|
|
|
232633 |
}
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
slapi_counter_set_value(r->protocol_timeout, ptimeout);
|
|
|
232633 |
@@ -1926,7 +1935,7 @@ _replica_init_from_config(Replica *r, Slapi_Entry *e, char *errortext)
|
|
|
232633 |
if ((val = slapi_entry_attr_get_charptr(e, type_replicaReleaseTimeout))) {
|
|
|
232633 |
if (repl_config_valid_num(type_replicaReleaseTimeout, val, 0, INT_MAX, &rc, errortext, &release_timeout) != 0) {
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
- return -1;
|
|
|
232633 |
+ return LDAP_UNWILLING_TO_PERFORM;
|
|
|
232633 |
}
|
|
|
232633 |
slapi_counter_set_value(r->release_timeout, release_timeout);
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
@@ -1950,7 +1959,7 @@ _replica_init_from_config(Replica *r, Slapi_Entry *e, char *errortext)
|
|
|
232633 |
type_replicaPrecisePurge, precise_purging);
|
|
|
232633 |
slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_init_from_config - "
|
|
|
232633 |
"%s\n", errormsg);
|
|
|
232633 |
- return -1;
|
|
|
232633 |
+ return LDAP_UNWILLING_TO_PERFORM;
|
|
|
232633 |
}
|
|
|
232633 |
slapi_ch_free_string(&precise_purging);
|
|
|
232633 |
} else {
|
|
|
232633 |
@@ -1963,7 +1972,7 @@ _replica_init_from_config(Replica *r, Slapi_Entry *e, char *errortext)
|
|
|
232633 |
if((val = slapi_entry_attr_get_charptr(e, attr_flags))) {
|
|
|
232633 |
if (repl_config_valid_num(attr_flags, val, 0, 1, &rc, errortext, &rflags) != 0) {
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
- return -1;
|
|
|
232633 |
+ return LDAP_UNWILLING_TO_PERFORM;
|
|
|
232633 |
}
|
|
|
232633 |
r->repl_flags = (uint32_t)rflags;
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
@@ -1990,7 +1999,7 @@ _replica_init_from_config(Replica *r, Slapi_Entry *e, char *errortext)
|
|
|
232633 |
int64_t rid;
|
|
|
232633 |
if (repl_config_valid_num(attr_replicaId, val, 1, 65534, &rc, errormsg, &rid) != 0) {
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
- return -1;
|
|
|
232633 |
+ return LDAP_UNWILLING_TO_PERFORM;
|
|
|
232633 |
}
|
|
|
232633 |
r->repl_rid = (ReplicaId)rid;
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
@@ -2000,7 +2009,7 @@ _replica_init_from_config(Replica *r, Slapi_Entry *e, char *errortext)
|
|
|
232633 |
attr_replicaId, (char *)slapi_entry_get_dn((Slapi_Entry *)e));
|
|
|
232633 |
slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name,
|
|
|
232633 |
"_replica_init_from_config - %s\n", errormsg);
|
|
|
232633 |
- return -1;
|
|
|
232633 |
+ return LDAP_OTHER;
|
|
|
232633 |
}
|
|
|
232633 |
}
|
|
|
232633 |
|
|
|
232633 |
@@ -2013,7 +2022,7 @@ _replica_init_from_config(Replica *r, Slapi_Entry *e, char *errortext)
|
|
|
232633 |
(char *)slapi_entry_get_dn((Slapi_Entry *)e));
|
|
|
232633 |
slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name,
|
|
|
232633 |
"_replica_init_from_config - %s\n", errormsg);
|
|
|
232633 |
- return -1;
|
|
|
232633 |
+ return LDAP_OTHER;
|
|
|
232633 |
}
|
|
|
232633 |
r->repl_csngen = object_new((void *)gen, (FNFree)csngen_free);
|
|
|
232633 |
|
|
|
232633 |
@@ -2031,7 +2040,7 @@ _replica_init_from_config(Replica *r, Slapi_Entry *e, char *errortext)
|
|
|
232633 |
if ((val = slapi_entry_attr_get_charptr(e, attr_replicaBindDnGroupCheckInterval))) {
|
|
|
232633 |
if (repl_config_valid_num(attr_replicaBindDnGroupCheckInterval, val, -1, INT_MAX, &rc, errormsg, &interval) != 0) {
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
- return -1;
|
|
|
232633 |
+ return LDAP_UNWILLING_TO_PERFORM;
|
|
|
232633 |
}
|
|
|
232633 |
r->updatedn_group_check_interval = interval;
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
@@ -2051,7 +2060,7 @@ _replica_init_from_config(Replica *r, Slapi_Entry *e, char *errortext)
|
|
|
232633 |
(char *)slapi_entry_get_dn((Slapi_Entry *)e), rc);
|
|
|
232633 |
slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name, "_replica_init_from_config - %s\n",
|
|
|
232633 |
errormsg);
|
|
|
232633 |
- return -1;
|
|
|
232633 |
+ return LDAP_OTHER;
|
|
|
232633 |
} else
|
|
|
232633 |
r->new_name = PR_TRUE;
|
|
|
232633 |
}
|
|
|
232633 |
@@ -2072,7 +2081,7 @@ _replica_init_from_config(Replica *r, Slapi_Entry *e, char *errortext)
|
|
|
232633 |
if ((val = slapi_entry_attr_get_charptr(e, type_replicaPurgeDelay))) {
|
|
|
232633 |
if (repl_config_valid_num(type_replicaPurgeDelay, val, -1, INT_MAX, &rc, errormsg, &interval) != 0) {
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
- return -1;
|
|
|
232633 |
+ return LDAP_UNWILLING_TO_PERFORM;
|
|
|
232633 |
}
|
|
|
232633 |
r->repl_purge_delay = interval;
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
@@ -2083,7 +2092,7 @@ _replica_init_from_config(Replica *r, Slapi_Entry *e, char *errortext)
|
|
|
232633 |
if ((val = slapi_entry_attr_get_charptr(e, type_replicaTombstonePurgeInterval))) {
|
|
|
232633 |
if (repl_config_valid_num(type_replicaTombstonePurgeInterval, val, -1, INT_MAX, &rc, errormsg, &interval) != 0) {
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
- return -1;
|
|
|
232633 |
+ return LDAP_UNWILLING_TO_PERFORM;
|
|
|
232633 |
}
|
|
|
232633 |
r->tombstone_reap_interval = interval;
|
|
|
232633 |
slapi_ch_free_string(&val;;
|
|
|
232633 |
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c
|
|
|
232633 |
index 7649aa14e..749e90936 100644
|
|
|
232633 |
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
|
|
|
232633 |
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
|
|
|
232633 |
@@ -267,9 +267,8 @@ replica_config_add(Slapi_PBlock *pb __attribute__((unused)),
|
|
|
232633 |
}
|
|
|
232633 |
|
|
|
232633 |
/* create replica object */
|
|
|
232633 |
- r = replica_new_from_entry(e, errortext, PR_TRUE /* is a newly added entry */);
|
|
|
232633 |
+ *returncode = replica_new_from_entry(e, errortext, PR_TRUE /* is a newly added entry */, &r);
|
|
|
232633 |
if (r == NULL) {
|
|
|
232633 |
- *returncode = LDAP_OPERATIONS_ERROR;
|
|
|
232633 |
goto done;
|
|
|
232633 |
}
|
|
|
232633 |
|
|
|
232633 |
--
|
|
|
232633 |
2.21.0
|
|
|
232633 |
|