Details
-
Bug
-
Status: Accepted
-
Normal
-
Resolution: Unresolved
-
PUP 4.2.1
-
None
-
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14] (Mac OSX Yosemite 10.10.5)
Puppet v4.2.1
-
Coremunity
Description
Using shellquote() to escape the output from template() of a file containing both single quotes and exclamation marks results in exclamation marks being improperly escaped (removing all single quotes results in correct escaping).
Example using small sample xml file:
irb(main):051:0> print scope.function_shellquote( \
|
[scope.function_template(['test.xml'])])
|
"<?xml version=\"1.0\"?>
|
<\!-- \"License\"); -->
|
<description> Using 'local.realm' to be </description>
|
"=> nil
|
|
bash-3.2$ echo "<?xml version=\"1.0\"?>
|
> <\!-- \"License\"); -->
|
> <description> Using 'local.realm' to be </description>
|
> "
|
<?xml version="1.0"?>
|
<\!-- "License"); -->
|
<description> Using 'local.realm' to be </description>
|
When it should be returned as:
bash-3.2$ echo "<?xml version=\"1.0\"?>
|
<"\!"-- \"License\"); -->
|
<description> Using 'local.realm' to be </description>
|
"
|
<?xml version="1.0"?>
|
<!-- "License"); -->
|
<description> Using 'local.realm' to be </description>
|
(notice extra quotes surrounding escaped exclamation mark)