diff options
| author | Ameya Varade <ameya.varade@clogeny.com> | 2013-06-24 16:49:35 +0530 |
|---|---|---|
| committer | adamedx <adamed@opscode.com> | 2013-06-25 07:24:05 -0700 |
| commit | 9678ccfae66c3c984b0f177dad39b9abbe6264d5 (patch) | |
| tree | 8569d89c3ecaac8758c2eaf5794d2221d727bd26 /lib/chef/util/windows | |
| parent | a85200206e8f6c7165cd9e0e47a294b76be278a2 (diff) | |
| download | chef-9678ccfae66c3c984b0f177dad39b9abbe6264d5.tar.gz | |
handle local password policies
Diffstat (limited to 'lib/chef/util/windows')
| -rw-r--r-- | lib/chef/util/windows/net_user.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/util/windows/net_user.rb b/lib/chef/util/windows/net_user.rb index 97d8f33834..69f18d8dc6 100644 --- a/lib/chef/util/windows/net_user.rb +++ b/lib/chef/util/windows/net_user.rb @@ -39,7 +39,7 @@ class Chef::Util::Windows::NetUser < Chef::Util::Windows #array index duals as structure offset USER_INFO_3 = [ [:name, nil], - [:password, nil], + [:password, ""], [:password_age, 0], [:priv, 0], #"The NetUserAdd and NetUserSetInfo functions ignore this member" [:home_dir, nil], @@ -183,12 +183,14 @@ class Chef::Util::Windows::NetUser < Chef::Util::Windows def disable_account user_modify do |user| user[:flags] |= UF_ACCOUNTDISABLE + user[:password] = nil end end def enable_account user_modify do |user| user[:flags] &= ~UF_ACCOUNTDISABLE + user[:password] = nil end end |
