diff options
author | Phil Dibowitz <phil@ipom.com> | 2015-01-14 10:05:55 -0800 |
---|---|---|
committer | Phil Dibowitz <phil@ipom.com> | 2015-01-14 10:05:55 -0800 |
commit | d1a70027b68b1ba6d36eea3bc38d5441a61f22f8 (patch) | |
tree | 02a036c858e55cd7c89a27f8f3fc0edb318e4985 /lib | |
parent | fdae4d506e9d77c7851826648202aa0525ef8955 (diff) | |
parent | 544f219e560448b2c4c697cfe23ceaecaeabfaba (diff) | |
download | chef-d1a70027b68b1ba6d36eea3bc38d5441a61f22f8.tar.gz |
Merge pull request #2724 from patcox/dscl_fix_salt_bug
OS X user provider - fix exception if no salt is found
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/provider/user/dscl.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/chef/provider/user/dscl.rb b/lib/chef/provider/user/dscl.rb index 39746f0018..4ad541c2ac 100644 --- a/lib/chef/provider/user/dscl.rb +++ b/lib/chef/provider/user/dscl.rb @@ -504,6 +504,11 @@ user password using shadow hash.") # password to be updated. return true if salted_sha512?(@current_resource.password) + # Some system users don't have salts; this can happen if the system is + # upgraded and the user hasn't logged in yet. In this case, we will force + # the password to be updated. + return true if @current_resource.salt.nil? + if salted_sha512_pbkdf2?(@new_resource.password) diverged?(:password) || diverged?(:salt) || diverged?(:iterations) else |