diff options
author | Claire McQuin <claire@getchef.com> | 2014-09-19 12:11:51 -0700 |
---|---|---|
committer | Claire McQuin <claire@getchef.com> | 2014-09-22 11:22:30 -0700 |
commit | f2089d8cbc8db391a4d28f220e69f340d7c36bfc (patch) | |
tree | ae56257c61e35aa09170ed66830bc37d9fda6a2c | |
parent | cb468126575d3e3f2995d4042a517a3bc1d74f06 (diff) | |
download | chef-f2089d8cbc8db391a4d28f220e69f340d7c36bfc.tar.gz |
Escape path for globbing.
-rw-r--r-- | lib/chef/provider/user/dscl.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/provider/user/dscl.rb b/lib/chef/provider/user/dscl.rb index a24a047596..a9edc29363 100644 --- a/lib/chef/provider/user/dscl.rb +++ b/lib/chef/provider/user/dscl.rb @@ -308,7 +308,7 @@ user password using shadow hash.") src = @current_resource.home FileUtils.mkdir_p(@new_resource.home) - files = ::Dir.glob("#{src}/*", ::File::FNM_DOTMATCH) - ["#{src}/.","#{src}/.."] + files = ::Dir.glob("#{Chef::Util::PathHelper.escape_glob(src)}/*", ::File::FNM_DOTMATCH) - ["#{src}/.","#{src}/.."] ::FileUtils.mv(files,@new_resource.home, :force => true) ::FileUtils.rmdir(src) ::FileUtils.chown_R(@new_resource.username,@new_resource.gid.to_s,@new_resource.home) @@ -555,7 +555,7 @@ user password using shadow hash.") user_info = nil # We flush the cache here in order to make sure that we read fresh information - # for the user. + # for the user. shell_out("dscacheutil '-flushcache'") begin |