Bug 737581 - ipa host-add Allowed to add host - hostname trailing space
Summary: ipa host-add Allowed to add host - hostname trailing space
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ipa
Version: 6.1
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Rob Crittenden
QA Contact: Chandrasekar Kannan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-12 15:45 UTC by Jenny Severance
Modified: 2015-01-04 23:51 UTC (History)
3 users (show)

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.
Clone Of:
Environment:
Last Closed: 2011-12-06 18:31:15 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1533 normal SHIPPED_LIVE Moderate: ipa security and bug fix update 2011-12-06 01:23:31 UTC

Description Jenny Severance 2011-09-12 15:45:54 UTC
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 17:08:36 UTC
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 11:57:34 UTC
    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 06:12:12 UTC
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 18:31:15 UTC
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.