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

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