Hello,

In this patch I am adding the mapping <my_hostname>=<IPA REALM> to krb5.conf as requested in https://fedorahosted.org/freeipa/ticket/5903.


From a1547a654d60562d7cdad259a06a4072d51f5a4f Mon Sep 17 00:00:00 2001
From: Stanislav Laznicka <slazn...@redhat.com>
Date: Thu, 2 Jun 2016 15:40:03 +0200
Subject: [PATCH] Added <my_hostname>=<IPA REALM> mapping to krb5.conf

https://fedorahosted.org/freeipa/ticket/5903
---
 client/ipa-client-install        | 11 +++++++----
 install/share/krb5.conf.template |  1 +
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/client/ipa-client-install b/client/ipa-client-install
index 538b6adee8a22839c5f16d46a242228ca3ca43ee..1606d1d2f8de0bcea13a8dce98d63d585edb8e58 100755
--- a/client/ipa-client-install
+++ b/client/ipa-client-install
@@ -1049,7 +1049,7 @@ def hardcode_ldap_server(cli_server):
     return
 
 def configure_krb5_conf(cli_realm, cli_domain, cli_server, cli_kdc, dnsok,
-        options, filename, client_domain):
+        options, filename, client_domain, client_hostname):
 
     krbconf = ipaclient.ipachangeconf.IPAChangeConf("IPA Installer")
     krbconf.setOptionAssignment((" = ", " "))
@@ -1108,7 +1108,8 @@ def configure_krb5_conf(cli_realm, cli_domain, cli_server, cli_kdc, dnsok,
 
     #[domain_realm]
     dropts = [{'name':'.'+cli_domain, 'type':'option', 'value':cli_realm},
-              {'name':cli_domain, 'type':'option', 'value':cli_realm}]
+              {'name':cli_domain, 'type':'option', 'value':cli_realm},
+              {'name':client_hostname, 'type':'option', 'value':cli_realm}]
 
     #add client domain mapping if different from server domain
     if cli_domain != client_domain:
@@ -2560,7 +2561,8 @@ def install(options, env, fstore, statestore):
                     dnsok=False,
                     options=options,
                     filename=krb_name,
-                    client_domain=client_domain):
+                    client_domain=client_domain,
+                    client_hostname=hostname):
                 root_logger.error("Test kerberos configuration failed")
                 return CLIENT_INSTALL_ERROR
             env['KRB5_CONFIG'] = krb_name
@@ -2761,7 +2763,8 @@ def install(options, env, fstore, statestore):
                 dnsok=dnsok,
                 options=options,
                 filename=paths.KRB5_CONF,
-                client_domain=client_domain):
+                client_domain=client_domain,
+                client_hostname=hostname):
             return CLIENT_INSTALL_ERROR
 
         root_logger.info(
diff --git a/install/share/krb5.conf.template b/install/share/krb5.conf.template
index 92431d3fde6afecd0e74803e18724379e8746f9b..631367777ca3e213c87ef51d02182569305f1690 100644
--- a/install/share/krb5.conf.template
+++ b/install/share/krb5.conf.template
@@ -26,6 +26,7 @@ $OTHER_LIBDEFAULTS
 [domain_realm]
  .$DOMAIN = $REALM
  $DOMAIN = $REALM
+ $FQDN = $REALM
 $OTHER_DOMAIN_REALM_MAPS
 [dbmodules]
   $REALM = {
-- 
2.5.5

-- 
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