From 9e7a3e7f3c46f8c2fc0b54353efd642b4178abf7 Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Mon, 25 Jul 2011 17:14:01 +0200 Subject: Make sure that hostname specified by user is not an IP address. ticket 1375 --- ipa-client/ipaclient/ipadiscovery.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ipa-client/ipaclient') diff --git a/ipa-client/ipaclient/ipadiscovery.py b/ipa-client/ipaclient/ipadiscovery.py index 77727b28e..ecd8275c4 100644 --- a/ipa-client/ipaclient/ipadiscovery.py +++ b/ipa-client/ipaclient/ipadiscovery.py @@ -24,7 +24,7 @@ import ipapython.dnsclient import tempfile import ldap from ldap import LDAPError -from ipapython.ipautil import run, CalledProcessError +from ipapython.ipautil import run, CalledProcessError, valid_ip NOT_FQDN = -1 @@ -119,6 +119,9 @@ class IPADiscovery: if not hostname: return BAD_HOST_CONFIG + if valid_ip(hostname): + return NOT_FQDN + # first, check for an LDAP server for the local domain p = hostname.find(".") if p == -1: #no domain name -- cgit