andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone

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

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