Make sure that hostname specified by user is not an IP address.

ticket 1375
This commit is contained in:
Jan Cholasta
2011-07-25 17:14:01 +02:00
committed by Rob Crittenden
parent 53ab352b4a
commit 9e7a3e7f3c
3 changed files with 10 additions and 1 deletions

View File

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