Red Hat Bugzilla – Bug 737581
ipa host-add Allowed to add host - hostname trailing space
Last modified: 2015-01-04 18:51:04 EST
Description of problem: especially from the UI, since someone may mistype. From the UI or from the CLI, add a host where the hostname has a trailing space ... ipa host-add "myhost .testrelm" Version-Release number of selected component (if applicable): ipa-server-2.1.1-1.el6.x86_64 How reproducible: always Steps to Reproduce: 1. see description 2. 3. Actual results: host added successfully Expected results: ipa: ERROR: invalid 'hostname': Leading and trailing spaces are not allowed Additional info:
https://fedorahosted.org/freeipa/ticket/1780 hostnames should be limited to a-z, 0-9 and -. The error message you will receive will be something like "invalid 'fqdn': may only include letters, numbers and -. There is a maximum length of 255.
Fixed upstream: master: https://fedorahosted.org/freeipa/changeset/8cf8870d3d11ace41cea1649d41f84341e0e94ac ipa-2-1: https://fedorahosted.org/freeipa/changeset/a27a820221634fc0e0489a8c2dab3f0e914daa2c
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Cause: A new Host is added to IPA server without proper validation Consequence: A Host with invalid hostname may be created. For example a hostname containing a white-space character Fix: Always check if the new Host has a valid hostname and return an error otherwise Result: Only Hosts with valid hostnames may be added.
From cli: [root@decepticons ~]# ipa host-add "myhost .testrelm" ipa: ERROR: invalid 'hostname': may only include letters, numbers, and - [root@decepticons ~]# From webui: IPA Error 3009 invalid 'hostname': may only include letters, numbers, and - error_log: [Thu Nov 03 11:37:14 2011] [error] ipa: INFO: admin@LAB.ENG.PNQ.REDHAT.COM: host_add(u'my host.lab.eng.pnq.redhat.com', force=u'false', ip_address=u'10.10.10.10'): ValidationError Verified in version: Name : ipa-server Relocations: (not relocatable) Version : 2.1.3 Vendor: Red Hat, Inc. Release : 8.el6 Build Date: Wed 02 Nov 2011 03:21:27 AM IST Install Date: Thu 03 Nov 2011 10:13:53 AM IST Build Host: x86-012.build.bos.redhat.com Group : System Environment/Base Source RPM: ipa-2.1.3-8.el6.src.rpm Size : 3381421 License: GPLv3+ Signature : (none) Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> URL : http://www.freeipa.org/ Summary : The IPA authentication server
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2011-1533.html