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
@@ -120,6 +120,9 @@ def verify_fqdn(host_name,no_host_dns=False):
|
||||
if host_name != host_name.lower():
|
||||
raise RuntimeError("Invalid hostname '%s', must be lower-case." % host_name)
|
||||
|
||||
if ipautil.valid_ip(host_name):
|
||||
raise RuntimeError("IP address not allowed as a hostname")
|
||||
|
||||
if no_host_dns:
|
||||
print "Warning: skipping DNS resolution of host", host_name
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user