Blame SOURCES/0005-Issue-5079-BUG-multiple-ways-to-specific-primary-508.patch

a77461
From 2ee8d9d2ce8bf252287089d18e15b519f15e9538 Mon Sep 17 00:00:00 2001
a77461
From: Firstyear <william@blackhats.net.au>
a77461
Date: Thu, 6 Jan 2022 09:49:30 +1000
a77461
Subject: [PATCH 1/5] Issue 5079 - BUG - multiple ways to specific primary
a77461
 (#5087)
a77461
a77461
Bug Description: In a winsync environment, we can only sync
a77461
changes to a primary replica. There are however, multiple
a77461
ways to specify which server is a primary for a replication
a77461
agreement, and I only accounted for one of them.
a77461
a77461
Fix Description: Improve the check to account for the
a77461
other primary replica flags.
a77461
a77461
fixes: https://github.com/389ds/389-ds-base/issues/5079
a77461
a77461
Author: William Brown <william@blackhats.net.au>
a77461
a77461
Review by: @droideck
a77461
---
a77461
 ldap/servers/plugins/replication/repl5_agmt.c | 4 +++-
a77461
 1 file changed, 3 insertions(+), 1 deletion(-)
a77461
a77461
diff --git a/ldap/servers/plugins/replication/repl5_agmt.c b/ldap/servers/plugins/replication/repl5_agmt.c
a77461
index 82efdcd15..a71343dec 100644
a77461
--- a/ldap/servers/plugins/replication/repl5_agmt.c
a77461
+++ b/ldap/servers/plugins/replication/repl5_agmt.c
a77461
@@ -482,7 +482,9 @@ agmt_new_from_entry(Slapi_Entry *e)
a77461
 
a77461
     /* DBDB: review this code */
a77461
     if (slapi_entry_attr_hasvalue(e, "objectclass", "nsDSWindowsReplicationAgreement")) {
a77461
-        if (replica && replica_get_type(replica) == REPLICA_TYPE_PRIMARY) {
a77461
+        if (replica_get_type(replica) == REPLICA_TYPE_PRIMARY
a77461
+           || (replica_get_type(replica) == REPLICA_TYPE_UPDATABLE && replica_is_flag_set(replica, REPLICA_LOG_CHANGES))
a77461
+        ) {
a77461
             ra->agreement_type = REPLICA_TYPE_WINDOWS;
a77461
             windows_init_agreement_from_entry(ra, e);
a77461
         } else {
a77461
-- 
a77461
2.37.1
a77461