[SSSD] [PATCH] IPA: Do not enable IPA sites in server mode

Jakub Hrozek jhrozek at redhat.com
Thu Sep 26 17:40:13 UTC 2013


On Wed, Sep 25, 2013 at 11:37:37AM +0200, Jakub Hrozek wrote:
> I realized this might be a nice chance when I was working on #2079. In
                                  ^^^^^^
                                  change
> the server mode, the IPA sites should be ignored, I think. But I don't
> think this patch is too important as IPA sites are still only
> experimental patches.

Rebased version of this minor patch is attached.
-------------- next part --------------
>From 75755ff6cfcbbc7583a07cfae4be5390fa59287a Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Thu, 26 Sep 2013 19:37:06 +0200
Subject: [PATCH] IPA: Do not enable IPA sites in server mode

When running in IPA server mode, the IPA sites should be ignored and the
SSSD should only connect to the local server.
---
 src/providers/ipa/ipa_init.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/providers/ipa/ipa_init.c b/src/providers/ipa/ipa_init.c
index b1440da163e94e043be74c76ce88c30d8ec7d771..bd63c944ec9354eeefd1d5ba1867360986efa5ee 100644
--- a/src/providers/ipa/ipa_init.c
+++ b/src/providers/ipa/ipa_init.c
@@ -242,20 +242,7 @@ int sssm_ipa_id_init(struct be_ctx *bectx,
     hostname = dp_opt_get_string(ipa_options->basic, IPA_HOSTNAME);
     server_mode = dp_opt_get_bool(ipa_options->basic, IPA_SERVER_MODE);
 
-    if (dp_opt_get_bool(ipa_options->basic, IPA_ENABLE_DNS_SITES)) {
-        /* use IPA plugin */
-        ipa_domain = dp_opt_get_string(ipa_options->basic, IPA_DOMAIN);
-        srv_ctx = ipa_srv_plugin_ctx_init(bectx, bectx->be_res->resolv,
-                                          hostname, ipa_domain);
-        if (srv_ctx == NULL) {
-            DEBUG(SSSDBG_FATAL_FAILURE, ("Out of memory?\n"));
-            ret = ENOMEM;
-            goto done;
-        }
-
-        be_fo_set_srv_lookup_plugin(bectx, ipa_srv_plugin_send,
-                                    ipa_srv_plugin_recv, srv_ctx, "IPA");
-    } else if (server_mode == true) {
+    if (server_mode == true) {
         ipa_servers = dp_opt_get_string(ipa_options->basic, IPA_SERVER);
         if (srv_in_server_list(ipa_servers) == true) {
             DEBUG(SSSDBG_MINOR_FAILURE, ("SRV resolution enabled on the IPA server. "
@@ -304,6 +291,19 @@ int sssm_ipa_id_init(struct be_ctx *bectx,
                       "will be ignored in ipa_server_mode\n"));
             }
         }
+    } else if (dp_opt_get_bool(ipa_options->basic, IPA_ENABLE_DNS_SITES)) {
+        /* use IPA plugin */
+        ipa_domain = dp_opt_get_string(ipa_options->basic, IPA_DOMAIN);
+        srv_ctx = ipa_srv_plugin_ctx_init(bectx, bectx->be_res->resolv,
+                                          hostname, ipa_domain);
+        if (srv_ctx == NULL) {
+            DEBUG(SSSDBG_FATAL_FAILURE, ("Out of memory?\n"));
+            ret = ENOMEM;
+            goto done;
+        }
+
+        be_fo_set_srv_lookup_plugin(bectx, ipa_srv_plugin_send,
+                                    ipa_srv_plugin_recv, srv_ctx, "IPA");
     } else {
         /* fall back to standard plugin on clients. */
         ret = be_fo_set_dns_srv_lookup_plugin(bectx, hostname);
-- 
1.8.3.1



More information about the sssd-devel mailing list