summaryrefslogtreecommitdiffstats
path: root/ipa-client/ipa-install/ipa-client-install
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2011-03-17 10:22:33 -0400
committerRob Crittenden <rcritten@redhat.com>2011-03-18 14:54:01 -0400
commit15e213d0258f69feaf6031a8721902f63c864ac2 (patch)
treed2951cc9b7020d5f0f569e7c2521a8535aac2dbb /ipa-client/ipa-install/ipa-client-install
parent861d1bbdca4793fb45fb233d236d3793cc23da36 (diff)
downloadfreeipa-15e213d0258f69feaf6031a8721902f63c864ac2.zip
freeipa-15e213d0258f69feaf6031a8721902f63c864ac2.tar.gz
freeipa-15e213d0258f69feaf6031a8721902f63c864ac2.tar.xz
Ensure that the system hostname is lower-case.
ticket 1080
Diffstat (limited to 'ipa-client/ipa-install/ipa-client-install')
-rwxr-xr-xipa-client/ipa-install/ipa-client-install13
1 files changed, 8 insertions, 5 deletions
diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index 4ff4c45..4e29fa9 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -681,6 +681,13 @@ def main():
if options.unattended and (options.password is None and options.principal is None and options.prompt_password is False) and not options.on_master:
sys.exit("One of password and principal are required.")
+ if options.hostname:
+ hostname = options.hostname
+ else:
+ hostname = socket.getfqdn()
+ if hostname != hostname.lower():
+ sys.exit('Invalid hostname \'%s\', must be lower-case.' % hostname)
+
# Create the discovery instance
ds = ipaclient.ipadiscovery.IPADiscovery()
@@ -756,6 +763,7 @@ def main():
logging.debug("will use cli_basedn: %s\n", cli_basedn)
subject_base = "O=%s" % ds.getRealmName()
+ print "Hostname: "+hostname
print "Realm: "+cli_realm
print "DNS Domain: "+cli_domain
print "IPA Server: "+cli_server
@@ -876,11 +884,6 @@ def main():
# Add the CA to the default NSS database and trust it
run(["/usr/bin/certutil", "-A", "-d", "/etc/pki/nssdb", "-n", "IPA CA", "-t", "CT,C,C", "-a", "-i", "/etc/ipa/ca.crt"])
- if options.hostname:
- hostname = options.hostname
- else:
- hostname = socket.getfqdn()
-
# If on master assume kerberos is already configured properly.
if not options.on_master:
# Configure krb5.conf