RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 1412490 - virt-who can't handle special character like "&*$" when run it in CLI
Summary: virt-who can't handle special character like "&*$" when run it in CLI
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-who
Version: 7.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: pre-dev-freeze
: ---
Assignee: Chris Snyder
QA Contact: Eko
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-12 07:22 UTC by Liushihui
Modified: 2019-10-28 07:20 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-11 20:31:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Liushihui 2017-01-12 07:22:11 UTC
Description of problem:
When run virt-who in CLI mode, it can't work when the options's value with "&*$"

Version-Release number of selected component (if applicable):
Satellite6.2.7
katello-3.0.0-15.el6sat.noarch
candlepin-0.9.54.15-1.el6.noarch
foreman-1.11.0.64-4.el6sat.noarch
virt-who-0.17-10.el6sat.noarch

How reproducible:
Always

Steps to Reproduce:
1. When run virt-who in CLI mode with --hyperv-password=Welcome&*$001, it will show error info as the following:
[root@hp-z220-05 virt-who.d]# virt-who --hyperv --hyperv-owner=Default_Organization --hyperv-env=Library --hyperv-server=10.73.5.227 --hyperv-username=administrator --hyperv-password=Welcome&*$001 -o -d
[1] 7443
-bash: *-bash01: command not found
[root@hp-z220-05 virt-who.d]# 2017-01-11 22:41:15,185 INFO: Using configuration "env/cmdline" ("hyperv" mode)
2017-01-11 22:41:15,186 INFO: Using reporter_id='hp-z220-05.qe.lab.eng.nay.redhat.com'
2017-01-11 22:41:15,248 ERROR: Virt backend 'env/cmdline' fails with error: Incorrect domain/username/password
2017-01-11 22:41:15,249 INFO: Waiting 60 seconds before retrying backend 'env/cmdline'

2. Click on "Ctrl + c" to end the session

3. Check virt-who's processes
[root@hp-z220-05 virt-who.d]# ps -ef|grep virt-who
root      7274  4751  1 22:37 pts/1    00:00:00 /usr/bin/python /usr/bin/virt-who --hyperv --hyperv-owner=Default_Organization --hyperv-env=Library --hyperv-server=10.73.5.227 --hyperv-username=administrator --hyperv-password=Welcome
root      7281  7274  0 22:37 pts/1    00:00:00 /usr/bin/python /usr/bin/virt-who --hyperv --hyperv-owner=Default_Organization --hyperv-env=Library --hyperv-server=10.73.5.227 --hyperv-username=administrator --hyperv-password=Welcome
root      7287  4751  0 22:38 pts/1    00:00:00 grep virt-who

4. If add quotes to --hyperv-password, it also failed to enter hyperv as "Incorrect domain/username/password"
[root@hp-z220-05 virt-who.d]# virt-who --hyperv --hyperv-owner=Default_Organization --hyperv-env=Library --hyperv-server=10.73.5.227 --hyperv-username=administrator --hyperv-password="Welcome&*$001" -o -d

Actual results:
1. As --hyperv-password with special characters as "&*$", it will failed to enter hyperv. Meanwhile, "ctrl+c" can't end debug mode.
2. Virt-who handle quotes to normal character

Expected results:
1. Although --hyperv-password with special characters as "&*$", it should enter hyperv successfully. Meanwhile, "ctrl+c" should end debug mode.
2. Virt-who should escape all characters in quotes:
for example: "Welcome&*$001" should escape to Welcome&*$001.

Additional info:
If configure password to non quotes (password=Welcome*&$001)or with quotes(password="Welcome*&$001"), virt-who can handle in to Welcome*&$001, virt-who can connect hyperv successfully.

Comment 4 Chris Snyder 2017-05-11 20:31:13 UTC
In current virt-who it appears that the password (given by running the command in the first comment) is read in as (less the quotes) "Welcome&*". This appears to be a result of bash attempting to replace $001 with the value of 001 from the environment (which is nothing).

If I run the command above with single quotes instead of double quotes, the password is read in to virt-who correctly.

Closing as not a bug (as there is nothing virt-who is doing wrong here)


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