mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Make sure that hostname specified by user is not an IP address.
ticket 1375
This commit is contained in:
committed by
Rob Crittenden
parent
53ab352b4a
commit
9e7a3e7f3c
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user