Bug 956618

Summary: scl-utils: better support for passing command arguments
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: scl-utilsAssignee: Jan Zeleny <jzeleny>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: bkabrda, jzeleny, stewartbrodie49
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-19 08:10:36 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:
Bug Depends On:    
Bug Blocks: 953462    

Description Florian Weimer 2013-04-25 10:18:07 UTC
If I want to run a program with "scl enable COLLECTION", I have to put the program and its arguments in a single argument string, with appropriate shell quoting.  It would be more convenient (and safer for custom-written scripts) if the scl program would accept a program and its arguments, preserve the argument list internally, and finally pass it to the program being executed.  This is similar to how "sudo" works, for instance.

Comment 1 Stewart Brodie 2013-06-17 14:32:04 UTC
This is show stopper for me.

I have a wrapper script for 'make' that my build system uses to set environment variables before calling the real make, so it sets things up and then does:  exec make "$@"

I now have a need to run make within an scl environment so I can use an alternative toolchain, but it doesn't work as I cannot re-quote the contents of $@ such that scl processes it correctly.

Comment 2 Jan Zeleny 2013-06-19 08:10:36 UTC
The only possible solution of this issue is requested in bug #924120

*** This bug has been marked as a duplicate of bug 924120 ***

Comment 3 Stewart Brodie 2014-03-26 11:09:46 UTC
Bug #924120 is not a duplicate of this issue.  That bug represents introducing the proper -- marker to delimit the scl parameters from the command to be executed.

This bug is about the command being executed with the wrong parameters, because scl is confused by quotes in parameters.

Now, the parameters are being written into the underlying script with unsafe quoting, so that if parameters contain quotes, it breaks.

If it really must write the command to a temporary shell script, the scl utility needs to use single quotes for the parameters and then carefully escape any single quotes found in the arguments that it is preserving.

However, it's no longer a show stopper for me as I wrote my own version of the scl utility as a very short shell script instead.

Comment 4 Stewart Brodie 2014-03-26 11:16:15 UTC
Bug #1030929 would probably fix this issue, instead.