Bug 1389092

Summary: domain name can include spaces
Product: Red Hat Quickstart Cloud Installer Reporter: James Olin Oden <joden>
Component: fusor-installerAssignee: Jason Montleon <jmontleo>
Status: CLOSED ERRATA QA Contact: James Olin Oden <joden>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.1CC: jkim, jmontleo, llasmith, qci-bugzillas
Target Milestone: ---Keywords: Triaged
Target Release: 1.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-28 01:40:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description James Olin Oden 2016-10-26 20:38:04 UTC
Description of problem:
If you select the "Domain" option in fusor-installer and enter a name with spaces in it like:

   b.b a

and then apply it (i.e. select Proceed with values shown), it will not be marked as invalid and be applied.

Version-Release number of selected component (if applicable):
QCI-1.1-RHEL-7-20161024.t.0

How reproducible:
every time

Steps to Reproduce:
1. in fusor-installer the Domain to "c.c a"
2. apply the changes

Actual results:
It will not complain and proceed with configuring the network.

Expected results:
It should say that the domain name is invalid.

Additional info:
When I looked through the system config files afterword I could see no sign of the bad domain name.   Additionally the hostname field requires you specify the FQDN, so it makes me wonder if you even need a Domain field to begin with.

Comment 2 Jason Montleon 2016-12-01 18:34:17 UTC
The domain name is to be set up on the capsule for dns. That's why you don't see the error in the systems configs (/etc/hosts, /etc/hostname, etc...). That said it does look to accept invalid input.

Comment 3 Jason Montleon 2016-12-01 19:24:33 UTC
https://github.com/fusor/fusor-installer/pull/101

I left out length checking on individual parts (no more than 64 characters for any part) given that Tasos has found you can create a domain longer than 64 characters and break all deployments as well as host+domain combinations longer than 64 causing problems as well.

Once we come up with an overall strategy we can add in length checking, which will in reality probably limit the overall length to well under 64 characters, let alone any part.

Comment 4 Landon LaSmith 2016-12-02 14:38:40 UTC
Previously filed bz#1400999 to track this but moving here since it's related to the same issue.

This will no longer allow 3 or more domains.

foo.bar == Valid domain
qci.foo.bar == Invalid domain

Comment 5 Jason Montleon 2016-12-02 14:40:24 UTC
Should be fixed with: https://github.com/fusor/fusor-installer/pull/102

Comment 6 Landon LaSmith 2016-12-02 14:44:54 UTC
*** Bug 1400999 has been marked as a duplicate of this bug. ***

Comment 7 James Olin Oden 2016-12-12 18:52:03 UTC
I just tried to set the hostname to "a b.c.d" and ended up with these results:

        new value for Hostname
        a b.c.d
        Usage: hostname [-b] {hostname|-F file}         set host name (from file)
               hostname [-a|-A|-d|-f|-i|-I|-s|-y]       display formatted name
               hostname                                 display host name

               {yp,nis,}domainname {nisdomain|-F file}  set NIS domain name (from file)
               {yp,nis,}domainname                      display NIS domain name

               dnsdomainname                            display dns domain name

               hostname -V|--version|-h|--help          print info and exit

        Program name:
               {yp,nis,}domainname=hostname -y
               dnsdomainname=hostname -d 
    
        Program options:
            -a, --alias            alias names
            -A, --all-fqdns        all long host names (FQDNs)
            -b, --boot             set default hostname if none available
            -d, --domain           DNS domain name
            -f, --fqdn, --long     long host name (FQDN)
            -F, --file             read host name or NIS domain name from given file
            -i, --ip-address       addresses for the host name
            -I, --all-ip-addresses all addresses for the host
            -s, --short            short host name
            -y, --yp, --nis        NIS/YP domain name
   
        Description:
           This command can get or set the host name or the NIS domain name. You can
           also get the DNS domain or the FQDN (fully qualified domain name).
           Unless you are using bind or NIS for host lookups you can change the
           FQDN (Fully Qualified Domain Name) and the DNS domain name (which is
           part of the FQDN) in the /etc/hosts file.
        Warning: Could not set hostname: false
        Hostname configuration updated!

Note, the hostname command was ran, it failed but its says the hostname configuration was updated properly.   Additionally its not catching the that there are spaces in the domain to begin with.   Really the hostname command never should have been ran at all.

It is allowing domains > 2 levels deep.

Comment 8 James Olin Oden 2016-12-12 18:53:06 UTC
This was done against compose:  QCI-1.1-RHEL-7-20161209.t.0

Comment 9 James Olin Oden 2016-12-12 19:03:47 UTC
Talked with jmontleo in development and we have decided that the original bug is fixed (which only deals catching domain name errors) and that this latest problem should go in a different bug.

So verified in:  QCI-1.1-RHEL-7-20161209.t.0

Comment 12 errata-xmlrpc 2017-02-28 01:40:32 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.

https://access.redhat.com/errata/RHEA-2017:0335