This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 737581 - ipa host-add Allowed to add host - hostname trailing space
ipa host-add Allowed to add host - hostname trailing space
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ipa (Show other bugs)
6.1
Unspecified Unspecified
medium Severity unspecified
: rc
: ---
Assigned To: Rob Crittenden
Chandrasekar Kannan
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-12 11:45 EDT by Jenny Galipeau
Modified: 2015-01-04 18:51 EST (History)
3 users (show)

See Also:
Fixed In Version: ipa-2.1.2-1.el6
Doc Type: Bug Fix
Doc Text:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-12-06 13:31:15 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Jenny Galipeau 2011-09-12 11:45:54 EDT
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:
Comment 2 Rob Crittenden 2011-09-12 13:08:36 EDT
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.
Comment 6 Martin Kosek 2011-11-01 07:57:34 EDT
    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.
Comment 7 Gowrishankar Rajaiyan 2011-11-03 02:12:12 EDT
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
Comment 8 errata-xmlrpc 2011-12-06 13:31:15 EST
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

Note You need to log in before you can comment on or make changes to this bug.