Bug 1403977 - Invalid hostnames cause errors when the hostname attempted to be set
Summary: Invalid hostnames cause errors when the hostname attempted to be set
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Quickstart Cloud Installer
Classification: Red Hat
Component: fusor-installer
Version: 1.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 1.1
Assignee: Jason Montleon
QA Contact: James Olin Oden
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-12 19:12 UTC by James Olin Oden
Modified: 2017-02-28 01:42 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-28 01:42:05 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:0335 0 normal SHIPPED_LIVE Red Hat Quickstart Installer 1.1 2017-02-28 06:36:13 UTC

Description James Olin Oden 2016-12-12 19:12:10 UTC
Description of problem:
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.



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

How reproducible:
Always

Steps to Reproduce:
1.  Install the QCI ISO.
2.  Start the system.
3.  Login
4.  When you can set the hostname in the fusor installer set it to a hostname
    with a space in it.

Actual results:
As above with the error output from hostname.

Expected results:
It to catch that there was a problem with the hostname before it passes it to
an external command.   Or at least not to see the external commands output, but the error acknowledged.

Comment 2 Jason Montleon 2016-12-12 19:43:09 UTC
This should clean up the output and error message so you don't see silliness like:

Warning: Could not set hostname: false
Hostname configuration updated!

https://github.com/fusor/fusor-installer/pull/105

Comment 3 James Olin Oden 2016-12-13 21:57:29 UTC
Verified in QCI-1.1-RHEL-7-20161212.t.2

Comment 6 errata-xmlrpc 2017-02-28 01:42:05 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


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