diff options
author | Mark Harrison <mark@mivok.net> | 2017-02-23 12:07:38 -0500 |
---|---|---|
committer | Thom May <thom@chef.io> | 2017-04-10 18:49:03 +0100 |
commit | 243123a599cc569d7fd9de33db3d94118c7cda33 (patch) | |
tree | a279e66e606a084ac5c52962b9e4457beeca920a /lib | |
parent | a7ceee2ac90b5003cea6dae0620d6abec0935d3a (diff) | |
download | chef-243123a599cc569d7fd9de33db3d94118c7cda33.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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/provider/package.rb | 6 |
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 |