summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Harrison <mark@mivok.net>2017-02-23 12:07:38 -0500
committerMark Harrison <mark@mivok.net>2017-02-23 12:07:38 -0500
commit41389d167af20f304bdce39483dc79b3ff411b12 (patch)
treef8f5ae2be764375bfa7d635c9749453ce9441a4b
parent42445a55fe97a4c8c1b5b88b91b38e3f15babc61 (diff)
downloadchef-41389d167af20f304bdce39483dc79b3ff411b12.tar.gz
Use shellsplit for apt_package options
This correctly deals with quotes and so on in package options. Fixes #5836 Signed-off-by: Mark Harrison <mark@mivok.net>
-rw-r--r--lib/chef/provider/package.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/chef/provider/package.rb b/lib/chef/provider/package.rb
index 8f504939fc..97aefbd559 100644
--- a/lib/chef/provider/package.rb
+++ b/lib/chef/provider/package.rb
@@ -23,6 +23,7 @@ require "chef/log"
require "chef/file_cache"
require "chef/platform"
require "chef/decorator/lazy_array"
+require "shellwords"
class Chef
class Provider
@@ -54,10 +55,7 @@ class Chef
def options
if new_resource.options.is_a?(String)
- # XXX: needs to handle double quotes, single quotes, nested quotes, etc and probably act
- # more like a space-separated "C"SV file -- although users can fix this just by passing in
- # a correctly pre-split Array.
- new_resource.options.split(" ")
+ new_resource.options.shellsplit
else
new_resource.options
end