summaryrefslogtreecommitdiff
path: root/lib/chef/provider
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-03-10 10:29:21 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2015-03-10 10:29:21 -0700
commite88c653016a1f0c5a115c762d9f727fcdfc59d43 (patch)
treea16e2cedcae497c0054efdb199e2dc8c433063de /lib/chef/provider
parent4b0f63b90cc72365fccd3f4f2e07721de7af80e6 (diff)
parent13d257e967c42822106c99ebdacf0b5514cdb2f0 (diff)
downloadchef-e88c653016a1f0c5a115c762d9f727fcdfc59d43.tar.gz
Merge pull request #3050 from chef/jdm/osx
Fix dscl issues for osx
Diffstat (limited to 'lib/chef/provider')
-rw-r--r--lib/chef/provider/user/dscl.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/chef/provider/user/dscl.rb b/lib/chef/provider/user/dscl.rb
index 0726b08ded..0c0c85e18b 100644
--- a/lib/chef/provider/user/dscl.rb
+++ b/lib/chef/provider/user/dscl.rb
@@ -652,7 +652,11 @@ user password using shadow hash.")
def run_plutil(*args)
result = shell_out("plutil -#{args.join(' ')}")
raise(Chef::Exceptions::PlistUtilCommandFailed,"plutil error: #{result.inspect}") unless result.exitstatus == 0
- result.stdout
+ if result.stdout.encoding == Encoding::ASCII_8BIT
+ result.stdout.encode("utf-8", "binary", :undef => :replace, :invalid => :replace, :replace => '?')
+ else
+ result.stdout
+ end
end
def convert_binary_plist_to_xml(binary_plist_string)