summaryrefslogtreecommitdiffstats
path: root/ipa-client/ipa-install/ipa-client-install
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-05-02 15:36:04 +0200
committerRob Crittenden <rcritten@redhat.com>2012-05-01 20:38:43 -0400
commitb8f30bce77837966597f5508625742c1bae04080 (patch)
tree473887cdc82bdd929443bc394103189f4e8cf05e /ipa-client/ipa-install/ipa-client-install
parent6569f355b61d4c0d55ca9ee2c5f36787cce73593 (diff)
downloadfreeipa.git-b8f30bce77837966597f5508625742c1bae04080.tar.gz
freeipa.git-b8f30bce77837966597f5508625742c1bae04080.tar.xz
freeipa.git-b8f30bce77837966597f5508625742c1bae04080.zip
Make ipa 2.2 client capable of joining an older server
IPA server of version 2.2 and higher supports Kerberos S4U2Proxy delegation, i.e. ipa command no longer forwards Kerberos TGT to the server during authentication. However, when IPA client of version 2.2 and higher tries to join an older IPA server, the installer crashes because the pre-2.2 server expects the TGT to be forwarded. This patch adds a fallback to ipa-client-install which would detect this situation and tries connecting with TGT forwarding enabled again. User is informed about this incompatibility. Missing realm was also added to keytab kinit as it was reported to fix occasional install issues. https://fedorahosted.org/freeipa/ticket/2697
Diffstat (limited to 'ipa-client/ipa-install/ipa-client-install')
-rwxr-xr-xipa-client/ipa-install/ipa-client-install26
1 files changed, 24 insertions, 2 deletions
diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index 7133cce0..67279b3e 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -1374,14 +1374,36 @@ def install(options, env, fstore, statestore):
os.environ['KRB5CCNAME'] = CCACHE_FILE
try:
- ipautil.run(['/usr/bin/kinit', '-k', '-t', '/etc/krb5.keytab', 'host/%s' % hostname])
- api.Backend.xmlclient.connect()
+ ipautil.run(['/usr/bin/kinit', '-k', '-t', '/etc/krb5.keytab', 'host/%s@%s' % (hostname, cli_realm)])
except CalledProcessError, e:
print >>sys.stderr, "Failed to obtain host TGT."
# fail to obtain ticket makes it impossible to login and bind from sssd to LDAP,
# abort installation and rollback changes
return CLIENT_INSTALL_ERROR
+ # Now, we have a TGT, lets try to connect to the server's XML-RPC interface
+ try:
+ api.Backend.xmlclient.connect()
+ except errors.KerberosError, e:
+ root_logger.debug('Cannot connect to the server due to Kerberos error: %s' % str(e))
+ root_logger.debug('Trying with delegate=True')
+ try:
+ api.Backend.xmlclient.connect(delegate=True)
+ root_logger.debug('Connection with delegate=True successful')
+
+ # The remote server is not capable of Kerberos S4U2Proxy delegation
+ # This features is implemented in IPA server version 2.2 and higher
+ print >>sys.stderr, "Target IPA server has a lower version that the enrolled client"
+ print >>sys.stderr, "Some capabilities including the ipa command capability may not be available"
+ except errors.PublicError, e2:
+ root_logger.debug('Second connect with delegate=True also failed: %s' % str(e2))
+ print >>sys.stderr, "Cannot connect to the IPA server XML-RPC interface: %s" % str(e2)
+ return CLIENT_INSTALL_ERROR
+ except errors.PublicError, e:
+ root_logger.debug('Cannot connect to the server due to generic error: %s' % str(e))
+ print >>sys.stderr, "Cannot connect to the IPA server XML-RPC interface: %s" % str(e)
+ return CLIENT_INSTALL_ERROR
+
if not options.on_master:
client_dns(cli_server, hostname, options.dns_updates)
configure_certmonger(fstore, subject_base, cli_realm, hostname, options)