summaryrefslogtreecommitdiff
path: root/lib/chef/util
diff options
context:
space:
mode:
authornimisha <nimisha.sharad@msystechnologies.com>2017-12-21 15:52:32 +0530
committernimisha <nimisha.sharad@msystechnologies.com>2018-01-24 15:00:40 +0530
commit7381679100ca96c63751cadff8b54722aefed5f4 (patch)
tree33de58126b040053a750260fe6c6156905446da2 /lib/chef/util
parent85e0c15d15425978de490bdce7fa7692690e6dc4 (diff)
downloadchef-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.rb10
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