mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Verify that the hostname is fully-qualified before accessing the service information in ipactl.
Fail gracefully if the supplied hostname isn't fully-qualified in ipa-server-install. ticket 1035
This commit is contained in:
parent
b02b77f8d7
commit
3656d9be3c
@ -573,15 +573,14 @@ def main():
|
||||
else:
|
||||
host_default = get_fqdn()
|
||||
|
||||
if options.unattended:
|
||||
try:
|
||||
try:
|
||||
if options.unattended:
|
||||
verify_fqdn(host_default,options.no_host_dns)
|
||||
except RuntimeError, e:
|
||||
sys.exit(str(e) + "\n")
|
||||
|
||||
host_name = host_default
|
||||
else:
|
||||
host_name = read_host_name(host_default,options.no_host_dns)
|
||||
host_name = host_default
|
||||
else:
|
||||
host_name = read_host_name(host_default,options.no_host_dns)
|
||||
except RuntimeError, e:
|
||||
sys.exit(str(e) + "\n")
|
||||
|
||||
host_name = host_name.lower()
|
||||
logging.debug("will use host_name: %s\n" % host_name)
|
||||
|
@ -295,6 +295,9 @@ def main():
|
||||
api.bootstrap(context='cli', debug=options.debug)
|
||||
api.finalize()
|
||||
|
||||
if '.' not in api.env.host:
|
||||
raise IpactlError("Invalid hostname, must be fully-qualified")
|
||||
|
||||
if args[0].lower() == "start":
|
||||
ipa_start()
|
||||
elif args[0].lower() == "stop":
|
||||
|
Loading…
Reference in New Issue
Block a user