This is a patch for the two issues reported in ticket #5035
https://fedorahosted.org/freeipa/ticket/5035
>From 7039d965919a631ac12ac366848c5dfaab475fe1 Mon Sep 17 00:00:00 2001
From: Ludwig Krispenz <lkris...@redhat.com>
Date: Fri, 29 May 2015 16:12:44 +0200
Subject: [PATCH] replica install fails with domain level 1

    when updating an replication agreement from a toplogy segment an incorrect default value was used for bindmethod.
    Only attributes explicitely set in the segment should be applied.
    At shutdown the server could crash because the plugin was called after it was stopped.

    https://fedorahosted.org/freeipa/ticket/5035
---
 daemons/ipa-slapi-plugins/topology/topology_agmt.c | 3 ++-
 daemons/ipa-slapi-plugins/topology/topology_init.c | 2 +-
 daemons/ipa-slapi-plugins/topology/topology_util.c | 3 ---
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/daemons/ipa-slapi-plugins/topology/topology_agmt.c b/daemons/ipa-slapi-plugins/topology/topology_agmt.c
index 57614351e79c6674c993df3d291bda8703e96369..05edad34288c1f82c0a8a2302fad4d286f508e15 100644
--- a/daemons/ipa-slapi-plugins/topology/topology_agmt.c
+++ b/daemons/ipa-slapi-plugins/topology/topology_agmt.c
@@ -70,7 +70,8 @@ int
 ipa_topo_agmt_new(char *hostname, TopoReplica *conf, TopoReplicaAgmt *agmt)
 {
     int ret = 0;
-    if (strcasecmp(agmt->repl_bind_method,"SASL/GSSAPI") == 0) {
+    if ((agmt->repl_bind_method == NULL) /* use GSSAPI as default */ ||
+         (strcasecmp(agmt->repl_bind_method,"SASL/GSSAPI") == 0)) {
         ret = ipa_topo_agmt_setup(hostname, conf, agmt, 1);
     } else {
         ret = ipa_topo_agmt_setup(hostname, conf, agmt, 0);
diff --git a/daemons/ipa-slapi-plugins/topology/topology_init.c b/daemons/ipa-slapi-plugins/topology/topology_init.c
index f45086760bbbe83d0296ae5ad814998fd522445e..77e740ea182c2331c88d2716d1c4f7be8ef8c257 100644
--- a/daemons/ipa-slapi-plugins/topology/topology_init.c
+++ b/daemons/ipa-slapi-plugins/topology/topology_init.c
@@ -225,12 +225,12 @@ static int
 ipa_topo_close(Slapi_PBlock * pb)
 {
 
+    ipa_topo_set_plugin_active(0);
     slapi_config_remove_callback(SLAPI_OPERATION_SEARCH, DSE_FLAG_PREOP,
             "", LDAP_SCOPE_BASE, "(objectclass=*)", ipa_topo_rootdse_search);
     slapi_unregister_backend_state_change((void *)ipa_topo_be_state_change);
     ipa_topo_free_plugin_config();
     return 0;
-
 }
 static int
 ipa_topo_rootdse_init(Slapi_PBlock *pb)
diff --git a/daemons/ipa-slapi-plugins/topology/topology_util.c b/daemons/ipa-slapi-plugins/topology/topology_util.c
index 94d8b33fdbbc6baecf5f775be8b2075be0822490..f206464a5b47b9dc7e0edd5dd764228b076b6dd9 100644
--- a/daemons/ipa-slapi-plugins/topology/topology_util.c
+++ b/daemons/ipa-slapi-plugins/topology/topology_util.c
@@ -329,9 +329,6 @@ ipa_topo_util_agmt_from_entry(Slapi_Entry *entry, char *replRoot, char *fromHost
             ipa_topo_util_set_segm_attr(agmt, mattrs[i], mval);
         }
     }
-    if (agmt->repl_bind_method == NULL) {
-        agmt->repl_bind_method = slapi_ch_strdup("SASL/GSSAPI");
-    }
     return agmt;
 }
 TopoReplicaSegment *
-- 
2.1.0

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to