summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authorKapil Chouhan <kapil.chouhan@msystechnologies.com>2019-05-02 17:02:25 +0530
committerKapil Chouhan <kapil.chouhan@msystechnologies.com>2019-05-10 14:54:48 +0530
commit0a8d0d20b4f3fc62eb768a40301d3046de09dd7a (patch)
tree9246ea0d65267c7deffb2b1dc7762fb1d44e6942 /lib/chef
parent61f69e18e69e0dca6e8cffdcd7451181d874cdb3 (diff)
downloadchef-0a8d0d20b4f3fc62eb768a40301d3046de09dd7a.tar.gz
Fix for Chef::Exceptions::Win32APIError: The operation completed successfully
Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com>
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/win32/security.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/win32/security.rb b/lib/chef/win32/security.rb
index 879aba7f2b..a633721839 100644
--- a/lib/chef/win32/security.rb
+++ b/lib/chef/win32/security.rb
@@ -404,7 +404,7 @@ class Chef
system_name = system_name.to_wstring if system_name
if LookupAccountNameW(system_name, name.to_wstring, nil, sid_size, nil, referenced_domain_name_size, nil)
raise "Expected ERROR_INSUFFICIENT_BUFFER from LookupAccountName, and got no error!"
- elsif FFI::LastError.error != ERROR_INSUFFICIENT_BUFFER
+ elsif !([NO_ERROR, ERROR_INSUFFICIENT_BUFFER].include?(FFI::LastError.error))
Chef::ReservedNames::Win32::Error.raise!
end