diff options
author | nimisha <nimisha.sharad@msystechnologies.com> | 2017-12-21 15:52:32 +0530 |
---|---|---|
committer | nimisha <nimisha.sharad@msystechnologies.com> | 2018-01-24 15:00:40 +0530 |
commit | 7381679100ca96c63751cadff8b54722aefed5f4 (patch) | |
tree | 33de58126b040053a750260fe6c6156905446da2 /lib/chef/util | |
parent | 85e0c15d15425978de490bdce7fa7692690e6dc4 (diff) | |
download | chef-7381679100ca96c63751cadff8b54722aefed5f4.tar.gz |
Fixed/added specs for LogonSession changes
Signed-off-by: nimisha <nimisha.sharad@msystechnologies.com>
Diffstat (limited to 'lib/chef/util')
-rw-r--r-- | lib/chef/util/windows/logon_session.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/chef/util/windows/logon_session.rb b/lib/chef/util/windows/logon_session.rb index 20c49cfd27..912a603865 100644 --- a/lib/chef/util/windows/logon_session.rb +++ b/lib/chef/util/windows/logon_session.rb @@ -25,7 +25,7 @@ class Chef class LogonSession include Chef::Mixin::WideString - def initialize(username, password, domain = nil, logon_type = :remote) + def initialize(username, password, domain = nil, authentication = :remote) if username.nil? || password.nil? raise ArgumentError, "The logon session must be initialize with non-nil user name and password parameters" end @@ -33,7 +33,7 @@ class Chef @original_username = username @original_password = password @original_domain = domain - @logon_type = logon_type + @authentication = authentication @token = FFI::Buffer.new(:pointer) @session_opened = false @impersonating = false @@ -48,9 +48,9 @@ class Chef password = wstring(original_password) domain = wstring(original_domain) - if logon_type == :remote + if authentication == :remote status = Chef::ReservedNames::Win32::API::Security.LogonUserW(username, domain, password, Chef::ReservedNames::Win32::API::Security::LOGON32_LOGON_NEW_CREDENTIALS, Chef::ReservedNames::Win32::API::Security::LOGON32_PROVIDER_DEFAULT, token) - elsif logon_type == :local + elsif authentication == :local status = Chef::ReservedNames::Win32::API::Security.LogonUserW(username, domain, password, Chef::ReservedNames::Win32::API::Security::LOGON32_LOGON_NETWORK, Chef::ReservedNames::Win32::API::Security::LOGON32_PROVIDER_DEFAULT, token) end @@ -115,7 +115,7 @@ class Chef attr_reader :original_username attr_reader :original_password attr_reader :original_domain - attr_reader :logon_type + attr_reader :authentication attr_reader :token attr_reader :session_opened |