summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Boreham <dboreham@redhat.com>2005-05-17 18:40:08 +0000
committerDavid Boreham <dboreham@redhat.com>2005-05-17 18:40:08 +0000
commit49e00bfc5c36852107cf427efdb5e51001e85b49 (patch)
tree3ac906c59e1d5e49984635a62628e5fdc8047dde
parent426c963ea98fd5b7f0b464ef64b03d12e3371c81 (diff)
downloadds-49e00bfc5c36852107cf427efdb5e51001e85b49.tar.gz
ds-49e00bfc5c36852107cf427efdb5e51001e85b49.tar.xz
ds-49e00bfc5c36852107cf427efdb5e51001e85b49.zip
Fix for 157919: perform fractional consumer check after acquiring the replica
-rw-r--r--ldap/servers/plugins/replication/repl5_protocol_util.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/ldap/servers/plugins/replication/repl5_protocol_util.c b/ldap/servers/plugins/replication/repl5_protocol_util.c
index 2756b77c..e6d8c957 100644
--- a/ldap/servers/plugins/replication/repl5_protocol_util.c
+++ b/ldap/servers/plugins/replication/repl5_protocol_util.c
@@ -199,22 +199,6 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv)
char *retoid = NULL;
Slapi_DN *replarea_sdn;
- /* Check if this is a fractional agreement, we need to
- * verify that the consumer is read-only */
- if (agmt_is_fractional(prp->agmt)) {
- crc = conn_replica_is_readonly(conn);
- if (CONN_IS_NOT_READONLY == crc) {
- /* This is a fatal error */
- slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
- "%s: Unable to acquire replica: "
- "the agreement is fractional but the replica is not read-only. Fractional agreements must specify a read-only replica "
- "Replication is aborting.\n",
- agmt_get_long_name(prp->agmt));
- return_value = ACQUIRE_FATAL_ERROR;
- goto error;
- }
- }
-
/* Good to go. Start the protocol. */
/* Obtain a current CSN */
@@ -375,6 +359,25 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv)
default:
return_value = ACQUIRE_FATAL_ERROR;
}
+ /* Now check for fractional compatibility with the replica
+ * We need to do the check now because prior to acquiring the
+ * replica we do not have sufficient access rights to read the replica id
+ */
+ /* Check if this is a fractional agreement, we need to
+ * verify that the consumer is read-only */
+ if (agmt_is_fractional(prp->agmt)) {
+ crc = conn_replica_is_readonly(conn);
+ if (CONN_IS_NOT_READONLY == crc) {
+ /* This is a fatal error */
+ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
+ "%s: Unable to acquire replica: "
+ "the agreement is fractional but the replica is not read-only. Fractional agreements must specify a read-only replica "
+ "Replication is aborting.\n",
+ agmt_get_long_name(prp->agmt));
+ return_value = ACQUIRE_FATAL_ERROR;
+ goto error;
+ }
+ }
}
else
{