Bug 1959136

Summary: Backtick in password causes failure during deployment of virt-who config.
Product: Red Hat Satellite Reporter: gtaylor
Component: Virt-who Configure PluginAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Kunxin Huang <kuhuang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.9.0CC: chrobert, mhulan, yanpliu, zhunting
Target Milestone: 6.12.0Keywords: Triaged
Target Release: Unused   
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: 2022-11-16 13:32:29 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 gtaylor 2021-05-10 18:37:29 UTC
Description of problem:
During deployment of a virt-who config, if the password contains a backtick, the script and 'hammer virt-who-config deploy ...' fail.  
The failure is due to using backticks in the code for command substitution and the backtick in the password is conflicting.  


Version-Release number of selected component (if applicable):
virt-who.noarch  0.28.10-1.el7_9

How reproducible:
Always


Steps to Reproduce:
1. Infrastructure > Virt-who Configurations > Create Config
2. Fill out the fields as required.  For the Hypervisor Password field use text with a backtick. e.g. my`password.
3. Click submit
4. Click the Deploy tab to copy the hammer command or the Configuration script. 
5. Run either the hammer command or configuration script.

Actual results:
When using the hammer command:
/tmp/virt_who20210507-1272-1n4wcfx: line 102: unexpected EOF while looking for matching `''
/tmp/virt_who20210507-1272-1n4wcfx: line 108: syntax error: unexpected end of file

When using the script:
./myvirtwho: line 55: unexpected EOF while looking for matching ``'
./myvirtwho: line 108: syntax error: unexpected end of file



Expected results:
== Finished ==
Finished successfully




Additional info:
Workaround. Use the script method instead of the 'hammer virt-who-config deploy ...' method.  In the script: replace the backticks used for command substitution with $(). 
53 #  cr_password=`virt-who-password --password 'virt`who' 2> /dev/null`
54   cr_password=$(virt-who-password --password 'virt`who' 2> /dev/null)

Comment 6 errata-xmlrpc 2022-11-16 13:32:29 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 (Important: Satellite 6.12 Release), 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-2022:8506