Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1559583 - Virt-who password encryption fails when the password has $ (Special Character).
Summary: Virt-who password encryption fails when the password has $ (Special Character).
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Virt-who Configure Plugin
Version: 6.3.0
Hardware: All
OS: Linux
high
high
Target Milestone: 6.4.0
Assignee: Marek Hulan
QA Contact: jcallaha
satellite-doc-list
URL:
Whiteboard:
: 1565163 1597209 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-22 19:57 UTC by Jaskaran Singh Narula
Modified: 2022-03-13 14:47 UTC (History)
13 users (show)

Fixed In Version: foreman_virt_who_configure 0.2.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-16 18:59:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 23027 0 High Closed Virt-who password encryption fails when the password has $ (Special Character). 2020-07-15 10:35:21 UTC

Description Jaskaran Singh Narula 2018-03-22 19:57:27 UTC
Description of problem:


Virt-who password encryption fails when the password has $ in it. Even it fails when you put in ( " " ) as well. 


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

Satellite-6.3.0-23.0.el7sat.noarch
satellite-6.2.13-4.0.el7sat.noarch
virt-who-0.19-8.el7_4.noarch


How reproducible:

Fire the following command:

step 1:
~~~~~~~~~~~~~~~
#virt-who-password --password="password"
~~~~~~~~~~~~~~~

Step 2:
~~~~~~~~~~~~~~
#virt-who-password
#password
~~~~~~~~~~~~~~

Step 3:
~~~~~~~~~~~~~~
#virt-who-password --password="pass$word"
~~~~~~~~~~~~~~

Step 4:
~~~~~~~~~~~~~~~
#virt-who-password 
#password
~~~~~~~~~~~~~~~


Actual results:

[root@localhost ~]# virt-who-password --password="red@hat"
Use following as value for encrypted_password key in the configuration file:
ca5fab1562e2f1a2192c25d34a85a0b2


[root@localhost ~]# virt-who-password
Password:                          =========>>> Password was = red@hat
Use following as value for encrypted_password key in the configuration file:
ca5fab1562e2f1a2192c25d34a85a0b2


[root@localhost ~]# virt-who-password --password="red$hat"
Use following as value for encrypted_password key in the configuration file:
6e7c223bd7a65c12eeb64d32be5dfe51


[root@localhost ~]# virt-who-password
Password:                        ============>>>> Password was red$hat 
Use following as value for encrypted_password key in the configuration file:
d9929330a8210748f1505b31b9629079


Expected results:

[root@localhost ~]# virt-who-password --password="red$hat"
Use following as value for encrypted_password key in the configuration file:
6e7c223bd7a65c12eeb64d32be5dfe51


[root@localhost ~]# virt-who-password
Password:                        ============>>>> Password was red$hat 
Use following as value for encrypted_password key in the configuration file:
6e7c223bd7a65c12eeb64d32be5dfe51



Additional info:

Comment 4 yuefliu 2018-03-26 11:31:49 UTC
No the issue after add translation symbol "\" as below:

# virt-who-password --password="red\$hat"
Use following as value for encrypted_password key in the configuration file:
ed556b933762b25d86acd2f679dc085c


# virt-who-password --password=red\$hat
Use following as value for encrypted_password key in the configuration file:
ed556b933762b25d86acd2f679dc085c


virt-who-password 
Password:                   ============>>>> Password was red$hat
Use following as value for encrypted_password key in the configuration file:
ed556b933762b25d86acd2f679dc085c

Comment 6 Chris Snyder 2018-03-26 14:54:38 UTC
This is not a bug in virt-who. When the '$' character is escaped virt-who-password works as designed. Please see comment 4 for additional details.

Comment 8 Marek Hulan 2018-03-27 12:14:06 UTC
Created redmine issue http://projects.theforeman.org/issues/23027 from this bug

Comment 10 Satellite Program 2018-04-06 16:07:59 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/23027 has been resolved.

Comment 11 Marek Hulan 2018-04-09 14:08:55 UTC
*** Bug 1565163 has been marked as a duplicate of this bug. ***

Comment 14 jcallaha 2018-07-05 15:52:58 UTC
Verified in Satellite 6.4 Snap 10

I followed the reporter's reproduction steps.

Resulting config is:
/etc/virt-who.d/virt-who-config-1.conf

### This configuration file is managed via the virt-who configure plugin
### manual edits will be deleted.
[virt-who-config-1]
type=esx
hypervisor_id=hostname
owner=Default_Organization
env=Library
server=test.server.com
username=domain\$atellite
encrypted_password=f931434859f3ea195b6ef6303d5a809b
rhsm_hostname=<my.sat.domain.com>
rhsm_username=virt_who_reporter_1
rhsm_encrypted_password=4def7ba2155a8f6eebde0c6650aaad5e7f9d5bf8762b6d66890620384a0d515a
rhsm_prefix=/rhsm

Comment 15 Marek Hulan 2018-08-01 12:20:32 UTC
*** Bug 1597209 has been marked as a duplicate of this bug. ***

Comment 16 Bryan Kearney 2018-10-16 18:59:42 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/RHSA-2018:2927


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