Bug 835363

Summary: Installation of rhev manager fails if a space is used in password.
Product: Red Hat Enterprise Virtualization Manager Reporter: Timothy Walsh <twalsh>
Component: ovirt-engine-setupAssignee: Kiril Nesenko <knesenko>
Status: CLOSED CURRENTRELEASE QA Contact: Ilanit Stein <istein>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0.2CC: asegundo, bazulay, dfediuck, dyasny, iheim, mkenneth, nmurray, Rhev-m-bugs, sgrinber, sputhenp, ykaul
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: integration
Fixed In Version: si15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-04 20:03:23 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:
Embargoed:

Description Timothy Walsh 2012-06-26 04:56:35 UTC
Description of problem:
Run the rhevm installation script and choose a password with an embedded space.


Version-Release number of selected component (if applicable):


How reproducible:
Always Fails.


Steps to Reproduce:
1. Use a password with an embedded space, eg red hat
  
Actual results:
2012-05-22 14:23:36::DEBUG::common_utils::197::root:: retcode = 1
2012-05-22 14:23:36::DEBUG::rhevm-setup::1960::root:: *** The following params were used as user input:
2012-05-22 14:23:36::DEBUG::rhevm-setup::1964::root:: override-iptables: no
2012-05-22 14:23:36::DEBUG::rhevm-setup::1964::root:: http-port: 8080
2012-05-22 14:23:36::DEBUG::rhevm-setup::1964::root:: https-port: 8443
2012-05-22 14:23:36::DEBUG::rhevm-setup::1964::root:: mac-range: 00:1A:4A:41:D3:00-00:1A:4A:41:D3:FF
2012-05-22 14:23:36::DEBUG::rhevm-setup::1964::root:: host-fqdn: vm187.gsslab.pnq.********.com
2012-05-22 14:23:36::DEBUG::rhevm-setup::1964::root:: auth-pass: ********
2012-05-22 14:23:36::DEBUG::rhevm-setup::1964::root:: db-pass: ********
2012-05-22 14:23:36::DEBUG::rhevm-setup::1964::root:: org-name: Red Hat
2012-05-22 14:23:36::DEBUG::rhevm-setup::1964::root:: default-dc-type: NFS
2012-05-22 14:23:36::DEBUG::rhevm-setup::1964::root:: config-nfs: no
2012-05-22 14:23:36::ERROR::rhevm-setup::2295::root:: Traceback (most recent call last):
  File "/usr/bin/rhevm-setup", line 2289, in <module>
    main(confFile)
  File "/usr/bin/rhevm-setup", line 2126, in main
    runMainFunctions(conf)
  File "/usr/bin/rhevm-setup", line 2043, in runMainFunctions
    runFunction([_createDB,  _updateVDCOptions], output_messages.INFO_CREATE_DB)
  File "/usr/bin/rhevm-setup", line 1397, in runFunction
    raise Exception(instance)
Exception: Failed updating configuration parameter: Error: failed updating configuration field CertAlias to rhevm


Expected results:
No Error

Additional info:

The problem is caused by /etc/pki/rhevm/encryptpasswd.sh on the rhevm server.

Lines 32 and 34 should have $1 wrapped as "$1" which tells the shell to ignore spaces in arg.

Comment 1 Amador Pahim 2012-08-08 21:21:16 UTC
Same issue here. Not fixed yet in upstream.
Patch sent: http://gerrit.ovirt.org/7024

Comment 2 Miki Kenneth 2012-08-09 07:44:44 UTC
No need to support white spaces in the password. Let's verify that and give a proper error message (and of course let the User pick another password).

Comment 3 Kiril Nesenko 2012-08-09 07:46:00 UTC
Patch posted for review: http://gerrit.ovirt.org/#/c/7033/

Comment 5 Ilanit Stein 2012-09-02 07:51:17 UTC
Verified on SI16.
Error is indeed givern "Error: White spaces are not allowed in passwords"

Full log:

[root@lilach-rhel yum.repos.d]# engine-setup
Welcome to RHEV Manager setup utility

In order to proceed the installer must stop the JBoss service
Would you like to stop the JBoss service? (yes|no): yes
Stopping JBoss... RHEV Manager uses httpd to proxy requests to the application server.
It looks like the httpd installed locally is being actively used.
The installer can override current configuration .
Alternatively you can use JBoss directly (on ports higher than 1024)
Do you wish to override current httpd configuration and restart the service? ['yes'| 'no']  [yes] : yes
HTTP Port  [80] : 
HTTPS Port  [443] : 
Host fully qualified domain name. Note: this name should be fully resolvable  [lilach-rhel.qa.lab.tlv.redhat.com] : 
Password for Administrator (admin@internal) :
Error: White spaces are not allowed in passwords
Password for Administrator (admin@internal) :
Error: White spaces are not allowed in passwords
Password for Administrator (admin@internal) :
Warning: Weak Password.
Confirm password :
Organization Name for the Certificate  [qa.lab.tlv.redhat.com] : 
The default storage type you will be using  ['NFS'| 'FC'| 'ISCSI']  [NFS] : 
Enter DB type for installation ['remote'| 'local']  [local] : 
Local database password :
Error: White spaces are not allowed in passwords
Local database password :
Error: White spaces are not allowed in passwords
Local database password :
Warning: Weak Password.
Confirm password :
Configure NFS share on this server to be used as an ISO Domain? ['yes'| 'no']  [yes] : no
Firewall ports need to be opened.
The installer can configure iptables automatically overriding the current configuration. The old configuration will be backed up.
Alternately you can configure the firewall later using an example iptables file found under /etc/ovirt-engine/iptables.example
Configure iptables ? ['yes'| 'no']: yes

RHEV Manager will be installed using the following configuration:
=================================================================
override-httpd-config:         yes
http-port:                     80
https-port:                    443
host-fqdn:                     lilach-rhel.qa.lab.tlv.redhat.com
auth-pass:                     ********
org-name:                      qa.lab.tlv.redhat.com
default-dc-type:               NFS
db-remote-install:             local
db-local-pass:                 ********
config-nfs:                    no
override-iptables:             yes
Proceed with the configuration listed above? (yes|no): yes

Installing:
Configuring RHEV Manager...                              [ DONE ]
Creating CA...                                           [ DONE ]
Editing JBoss Configuration...                           [ DONE ]
Setting Database Configuration...                        [ DONE ]
Setting Database Security...                             [ DONE ]
Creating Database...                                     [ DONE ]
Updating the Default Data Center Storage Type...         [ DONE ]
Editing RHEV Manager Configuration...                    [ DONE ]
Editing Postgresql Configuration...                      [ DONE ]
Configuring Firewall (iptables)...                       [ DONE ]
Starting JBoss Service...                                [ DONE ]
Configuring HTTPD...                                     [ DONE ]

 **** Installation completed successfully ******

     (Please allow RHEV Manager a few moments to start up.....)

**** To access RHEV Manager browse to http://lilach-rhel.qa.lab.tlv.redhat.com:80 ****

Additional information:
 * There are less than 4 GBs of available free memory on this machine.
It is  recommended to have at least 4 GBs of available memory to run the RHEV Manager.
 * RHEV Manager CA SSL Certificate SHA1 fingerprint: BB:7A:FD:41:A6:03:BB:97:E7:71:44:16:C5:0F:2E:1B:DE:99:DD:6F
 * SSH Public key fingerprint: e4:4a:75:a7:81:d7:99:9f:38:26:c1:bf:85:b1:74:4d
 * The firewall has been updated, the old iptables configuration file was saved to /var/lib/ovirt-engine/backups/iptables.backup.105042-09022012_3115
 * The installation log file is available at: /var/log/ovirt-engine/engine-setup_2012_09_02_10_47_30.log
 * Please use the user "admin" and password specified in order to login into RHEV Manager
 * To configure additional users, first configure authentication domains using the 'rhevm-manage-domains' utility
[root@lilach-rhel yum.repos.d]#