Bug 1032550

Summary: scl command splits arguments with white-space
Product: [Fedora] Fedora Reporter: Honza Horak <hhorak>
Component: scl-utilsAssignee: Jan Zeleny <jzeleny>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: bkabrda, jzeleny
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: scl-utils-20140127-1.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-01 14:05:58 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:
Attachments:
Description Flags
Proposed patch -- use quotes for arguments in the bash script none

Description Honza Horak 2013-11-20 11:44:47 UTC
Description of problem:
When we run scl with -- separator and use a command that includes a white-space in an argument (we need to use quotes), the quotes disappear when a bash script is being created and as a consequence, scl call runs the command with different (split) arguments than the same command run without scl.

Version-Release number of selected component (if applicable):
scl-utils-20131017-1

How reproducible:
every-time

Steps to Reproduce:
1. cat >foo.sh<<EOF
#!/bin/bash
while [ ! -z "\$1" ] ; do
    echo \$1
    shift
done
EOF
2. $ chmod a+x foo.sh
3. $ export A="f g"
4. $ export B="h i"
5. $ echo "Without scl:"
6. $ ./foo.sh a b "c d" e $A "$B" j
7. $ echo "With scl:"
8. $ scl enable mysql55 -- ./foo.sh a b "c d" e $A "$B" j

Actual results:
Both outputs (run the same command using scl and without scl) differ:

Without scl:
a
b
c d
e
f
g
h i
j
With scl:
a
b
c
d
e
f
g
h
i
j

Expected results:
Both outputs are same:

Without scl:
a
b
c d
e
f
g
h i
j
With scl:
a
b
c d
e
f
g
h i
j

Comment 1 Honza Horak 2013-11-20 11:51:41 UTC
Created attachment 826574 [details]
Proposed patch -- use quotes for arguments in the bash script

Comment 2 Jan Zeleny 2013-11-20 12:09:33 UTC
Applied upstream, thanks for the patch.

Comment 3 Fedora Update System 2014-01-10 14:04:55 UTC
scl-utils-20140108-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/scl-utils-20140108-1.fc19

Comment 4 Fedora Update System 2014-01-10 14:05:15 UTC
scl-utils-20140108-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/scl-utils-20140108-1.fc20

Comment 5 Fedora Update System 2014-01-11 08:30:47 UTC
Package scl-utils-20140108-1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing scl-utils-20140108-1.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-0600/scl-utils-20140108-1.fc19
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2014-01-27 12:08:07 UTC
scl-utils-20140127-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/scl-utils-20140127-1.fc19

Comment 7 Fedora Update System 2014-01-27 12:08:39 UTC
scl-utils-20140127-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/scl-utils-20140127-1.fc20

Comment 8 Fedora Update System 2014-03-01 14:05:58 UTC
scl-utils-20140127-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2014-03-01 14:13:52 UTC
scl-utils-20140127-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.