[SSSD] [PATCH] IPA: Default to krb5_use_fast=try

Jakub Hrozek jhrozek at redhat.com
Tue Feb 11 16:32:17 UTC 2014


Hi,

as agreed with Nathaniel, we should change the defaults of krb_use_fast
to "try" with the IPA backend and also change the default of
krb5_fast_principal to "host/$client_hostname".

So far I've tested this patch on F-20 only with IPA server
3.3.90GIT0f82cbf. More testing is needed with older IPA servers as well,
but that shouldn't block the patch review.
-------------- next part --------------
>From 1d3e21d953ebe6f2ae56ca4dd6b1174b80fdc1cc Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Tue, 11 Feb 2014 15:36:04 +0100
Subject: [PATCH] IPA: Default to krb5_use_fast=try

---
 src/providers/ipa/ipa_common.c | 19 +++++++++++++++++++
 src/providers/ipa/ipa_opts.h   |  2 +-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/providers/ipa/ipa_common.c b/src/providers/ipa/ipa_common.c
index 671374098afa1f2e00fc9cf1788ba4383b600a1b..09b7b7a668e3213df608869d51c58f16c92671f7 100644
--- a/src/providers/ipa/ipa_common.c
+++ b/src/providers/ipa/ipa_common.c
@@ -664,6 +664,25 @@ int ipa_get_auth_options(struct ipa_options *ipa_opts,
                   dp_opt_get_string(ipa_opts->auth, KRB5_REALM)));
     }
 
+    /* If krb5_fast_principal was not set explicitly, default to
+     * host/$client_hostname
+     */
+    value = dp_opt_get_string(ipa_opts->auth, KRB5_FAST_PRINCIPAL);
+    if (value == NULL) {
+        value = talloc_asprintf(ipa_opts->auth, "host/%s",
+                                    dp_opt_get_string(ipa_opts->basic,
+                                                      IPA_HOSTNAME));
+        if (value == NULL) {
+            DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot set %s!\n",
+                     ipa_opts->auth[KRB5_FAST_PRINCIPAL].opt_name));
+            ret = ENOMEM;
+            goto done;
+        }
+
+        DEBUG(SSSDBG_CONF_SETTINGS, ("Option %s set to %s\n",
+              ipa_opts->auth[KRB5_FAST_PRINCIPAL].opt_name, value));
+    }
+
     /* Set flag that controls whether we want to write the
      * kdcinfo files at all
      */
diff --git a/src/providers/ipa/ipa_opts.h b/src/providers/ipa/ipa_opts.h
index bf9f3bc4288af0f7eba715e4c768cc3043472e95..909c431eefa778f97767af241829ac81256fc464 100644
--- a/src/providers/ipa/ipa_opts.h
+++ b/src/providers/ipa/ipa_opts.h
@@ -275,7 +275,7 @@ struct dp_option ipa_def_krb5_opts[] = {
     { "krb5_renewable_lifetime", DP_OPT_STRING, NULL_STRING, NULL_STRING },
     { "krb5_lifetime", DP_OPT_STRING, NULL_STRING, NULL_STRING },
     { "krb5_renew_interval", DP_OPT_STRING, NULL_STRING, NULL_STRING },
-    { "krb5_use_fast", DP_OPT_STRING, NULL_STRING, NULL_STRING },
+    { "krb5_use_fast", DP_OPT_STRING, { "try" }, NULL_STRING },
     { "krb5_fast_principal", DP_OPT_STRING, NULL_STRING, NULL_STRING },
     { "krb5_canonicalize", DP_OPT_BOOL, BOOL_TRUE, BOOL_TRUE },
     { "krb5_use_enterprise_principal", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
-- 
1.8.5.3



More information about the sssd-devel mailing list