Blame SOURCES/0015-Issue-4700-Regression-in-winsync-replication-agreeme.patch

b8da0b
From 8d06fdf44b0d337f1e321e61ee1b22972ddea917 Mon Sep 17 00:00:00 2001
b8da0b
From: tbordaz <tbordaz@redhat.com>
b8da0b
Date: Fri, 2 Apr 2021 14:05:41 +0200
b8da0b
Subject: [PATCH 3/3] Issue 4700 - Regression in winsync replication agreement
b8da0b
 (#4712)
b8da0b
b8da0b
Bug description:
b8da0b
	#4396 fixes a memory leak but did not set 'cn=config' as
b8da0b
	DSE backend.
b8da0b
	It had no signicant impact unless with sidgen IPA plugin
b8da0b
b8da0b
Fix description:
b8da0b
	revert the portion of the #4364 patch that set be_suffix
b8da0b
	in be_addsuffix, free the suffix before setting it
b8da0b
b8da0b
relates: https://github.com/389ds/389-ds-base/issues/4700
b8da0b
b8da0b
Reviewed by: Pierre Rogier (thanks !)
b8da0b
b8da0b
Platforms tested: F33
b8da0b
---
b8da0b
 ldap/servers/slapd/backend.c | 3 ++-
b8da0b
 ldap/servers/slapd/fedse.c   | 6 +++++-
b8da0b
 2 files changed, 7 insertions(+), 2 deletions(-)
b8da0b
b8da0b
diff --git a/ldap/servers/slapd/backend.c b/ldap/servers/slapd/backend.c
b8da0b
index 5707504a9..5db706841 100644
b8da0b
--- a/ldap/servers/slapd/backend.c
b8da0b
+++ b/ldap/servers/slapd/backend.c
b8da0b
@@ -173,7 +173,8 @@ void
b8da0b
 be_addsuffix(Slapi_Backend *be, const Slapi_DN *suffix)
b8da0b
 {
b8da0b
     if (be->be_state != BE_STATE_DELETED) {
b8da0b
-        be->be_suffix = slapi_sdn_dup(suffix);;
b8da0b
+        slapi_sdn_free(&be->be_suffix);
b8da0b
+        be->be_suffix = slapi_sdn_dup(suffix);
b8da0b
     }
b8da0b
 }
b8da0b
 
b8da0b
diff --git a/ldap/servers/slapd/fedse.c b/ldap/servers/slapd/fedse.c
b8da0b
index 7b820b540..44159c991 100644
b8da0b
--- a/ldap/servers/slapd/fedse.c
b8da0b
+++ b/ldap/servers/slapd/fedse.c
b8da0b
@@ -2846,6 +2846,7 @@ setup_internal_backends(char *configdir)
b8da0b
         Slapi_DN counters;
b8da0b
         Slapi_DN snmp;
b8da0b
         Slapi_DN root;
b8da0b
+        Slapi_Backend *be;
b8da0b
         Slapi_DN encryption;
b8da0b
         Slapi_DN saslmapping;
b8da0b
         Slapi_DN plugins;
b8da0b
@@ -2894,7 +2895,10 @@ setup_internal_backends(char *configdir)
b8da0b
         dse_register_callback(pfedse, SLAPI_OPERATION_ADD, DSE_FLAG_PREOP, &saslmapping, LDAP_SCOPE_SUBTREE, "(objectclass=nsSaslMapping)", sasl_map_config_add, NULL, NULL);
b8da0b
         dse_register_callback(pfedse, SLAPI_OPERATION_ADD, DSE_FLAG_PREOP, &plugins, LDAP_SCOPE_SUBTREE, "(objectclass=nsSlapdPlugin)", check_plugin_path, NULL, NULL);
b8da0b
 
b8da0b
-        be_new_internal(pfedse, "DSE", DSE_BACKEND, &fedse_plugin);
b8da0b
+        be = be_new_internal(pfedse, "DSE", DSE_BACKEND, &fedse_plugin);
b8da0b
+        be_addsuffix(be, &root);
b8da0b
+        be_addsuffix(be, &monitor);
b8da0b
+        be_addsuffix(be, &config);
b8da0b
 
b8da0b
         /*
b8da0b
          * Now that the be's are in place, we can setup the mapping tree.
b8da0b
-- 
b8da0b
2.31.1
b8da0b