Blame SOURCES/0095-failover-mark-subdomain-service-with-sd_-prefix.patch

b2d430
From a3b502fa85d493795c963e4298aeec3dc5806fcf Mon Sep 17 00:00:00 2001
b2d430
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
b2d430
Date: Wed, 29 Jun 2016 14:58:37 +0200
b2d430
Subject: [PATCH 095/102] failover: mark subdomain service with sd_ prefix
b2d430
MIME-Version: 1.0
b2d430
Content-Type: text/plain; charset=UTF-8
b2d430
Content-Transfer-Encoding: 8bit
b2d430
b2d430
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
b2d430
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
b2d430
(cherry picked from commit 778f241e78241b0d6b8734148175f8dee804f494)
b2d430
---
b2d430
 src/providers/ad/ad_subdomains.c          | 11 +++++++++--
b2d430
 src/providers/ipa/ipa_subdomains_server.c | 11 +++++++++--
b2d430
 2 files changed, 18 insertions(+), 4 deletions(-)
b2d430
b2d430
diff --git a/src/providers/ad/ad_subdomains.c b/src/providers/ad/ad_subdomains.c
b2d430
index e9da04e384e598927f9c8c203a751bcccd29e895..a0d5c2e544fc62fda64771dce59b3b7ab8ecd8b6 100644
b2d430
--- a/src/providers/ad/ad_subdomains.c
b2d430
+++ b/src/providers/ad/ad_subdomains.c
b2d430
@@ -66,6 +66,7 @@ ad_subdom_ad_ctx_new(struct be_ctx *be_ctx,
b2d430
     struct ad_options *ad_options;
b2d430
     struct ad_id_ctx *ad_id_ctx;
b2d430
     const char *gc_service_name;
b2d430
+    const char *service_name;
b2d430
     struct ad_srv_plugin_ctx *srv_ctx;
b2d430
     char *ad_domain;
b2d430
     char *ad_site_override;
b2d430
@@ -94,14 +95,20 @@ ad_subdom_ad_ctx_new(struct be_ctx *be_ctx,
b2d430
 
b2d430
     ad_site_override = dp_opt_get_string(ad_options->basic, AD_SITE);
b2d430
 
b2d430
-    gc_service_name = talloc_asprintf(ad_options, "%s%s", "gc_", subdom->name);
b2d430
+    gc_service_name = talloc_asprintf(ad_options, "sd_gc_%s", subdom->name);
b2d430
     if (gc_service_name == NULL) {
b2d430
         talloc_free(ad_options);
b2d430
         return ENOMEM;
b2d430
     }
b2d430
 
b2d430
+    service_name = talloc_asprintf(ad_options, "sd_%s", subdom->name);
b2d430
+    if (service_name == NULL) {
b2d430
+        talloc_free(ad_options);
b2d430
+        return ENOMEM;
b2d430
+    }
b2d430
+
b2d430
     ret = ad_failover_init(ad_options, be_ctx, NULL, NULL, realm,
b2d430
-                           subdom->name, gc_service_name,
b2d430
+                           service_name, gc_service_name,
b2d430
                            subdom->name, &ad_options->service);
b2d430
     if (ret != EOK) {
b2d430
         DEBUG(SSSDBG_OP_FAILURE, "Cannot initialize AD failover\n");
b2d430
diff --git a/src/providers/ipa/ipa_subdomains_server.c b/src/providers/ipa/ipa_subdomains_server.c
b2d430
index 43636098f6928006db0e0a9c05f2e39f8427d705..13640b04d66a1cdbbf0c8eab7648f7ebe921884b 100644
b2d430
--- a/src/providers/ipa/ipa_subdomains_server.c
b2d430
+++ b/src/providers/ipa/ipa_subdomains_server.c
b2d430
@@ -203,6 +203,7 @@ ipa_ad_ctx_new(struct be_ctx *be_ctx,
b2d430
     struct ad_options *ad_options;
b2d430
     struct ad_id_ctx *ad_id_ctx;
b2d430
     const char *gc_service_name;
b2d430
+    const char *service_name;
b2d430
     struct ad_srv_plugin_ctx *srv_ctx;
b2d430
     const char *ad_domain;
b2d430
     const char *ad_site_override;
b2d430
@@ -250,17 +251,23 @@ ipa_ad_ctx_new(struct be_ctx *be_ctx,
b2d430
         DEBUG(SSSDBG_TRACE_ALL, "No extra attrs set.\n");
b2d430
     }
b2d430
 
b2d430
-    gc_service_name = talloc_asprintf(ad_options, "%s%s", "gc_", subdom->forest);
b2d430
+    gc_service_name = talloc_asprintf(ad_options, "sd_gc_%s", subdom->forest);
b2d430
     if (gc_service_name == NULL) {
b2d430
         talloc_free(ad_options);
b2d430
         return ENOMEM;
b2d430
     }
b2d430
 
b2d430
+    service_name = talloc_asprintf(ad_options, "sd_%s", subdom->name);
b2d430
+    if (service_name == NULL) {
b2d430
+        talloc_free(ad_options);
b2d430
+        return ENOMEM;
b2d430
+    }
b2d430
+
b2d430
     /* Set KRB5 realm to same as the one of IPA when IPA
b2d430
      * is able to attach PAC. For testing, use hardcoded. */
b2d430
     ret = ad_failover_init(ad_options, be_ctx, NULL, NULL,
b2d430
                            id_ctx->server_mode->realm,
b2d430
-                           subdom->name, gc_service_name,
b2d430
+                           service_name, gc_service_name,
b2d430
                            subdom->name, &ad_options->service);
b2d430
     if (ret != EOK) {
b2d430
         DEBUG(SSSDBG_OP_FAILURE, "Cannot initialize AD failover\n");
b2d430
-- 
b2d430
2.4.11
b2d430