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/mixin | |
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/mixin')
-rw-r--r-- | lib/chef/mixin/user_context.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/chef/mixin/user_context.rb b/lib/chef/mixin/user_context.rb index 0807bd5a95..f5c2da1389 100644 --- a/lib/chef/mixin/user_context.rb +++ b/lib/chef/mixin/user_context.rb @@ -22,8 +22,10 @@ class Chef module Mixin module UserContext - # valid logon_type values => :remote, :local - def with_user_context(user, password, domain = nil, logon_type = :remote, &block) + # valid values for authentication => :remote, :local + # When authentication = :local, we use the credentials to create a logon session against the local system, and then try to access the files. + # When authentication = :remote, we continue with the current user but pass the provided credentials to the remote system. + def with_user_context(user, password, domain = nil, authentication = :remote, &block) unless Chef::Platform.windows? raise Exceptions::UnsupportedPlatform, "User context impersonation is supported only on the Windows platform" end @@ -36,7 +38,7 @@ class Chef begin if user - logon_session = Chef::Util::Windows::LogonSession.new(user, password, domain, logon_type) + logon_session = Chef::Util::Windows::LogonSession.new(user, password, domain, authentication) logon_session.open logon_session.set_user_context end |