diff options
author | Tim Smith <tsmith@chef.io> | 2018-03-29 14:02:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-29 14:02:51 -0700 |
commit | 5522c964dbb7d2e06be74f4aaf6b26dd126f4875 (patch) | |
tree | 27c6fe9edaa7682858f555a5753aafad7b59aa8c /lib | |
parent | 781ae80b17883382d35bf0acd374aec766f37f9c (diff) | |
parent | 0698ccebd1f40a2ad21230813cbafb0330b0d107 (diff) | |
download | chef-5522c964dbb7d2e06be74f4aaf6b26dd126f4875.tar.gz |
Merge pull request #7083 from chef/btm/fix-windows-service
Avoid lookups for rights of 'LocalSystem' in windows service
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/provider/service/windows.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/provider/service/windows.rb b/lib/chef/provider/service/windows.rb index cba626145a..417ec03ef4 100644 --- a/lib/chef/provider/service/windows.rb +++ b/lib/chef/provider/service/windows.rb @@ -93,7 +93,8 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service Win32::Service.configure(new_config) logger.info "#{@new_resource} configured with #{new_config.inspect}" - if new_config.has_key?(:service_start_name) + # LocalSystem is the default runas user, which is a special service account that should ultimately have the rights of BUILTIN\Administrators, but we wouldn't see that from get_account_right + if new_config.has_key?(:service_start_name) && new_config[:service_start_name].casecmp("localsystem") != 0 unless Chef::ReservedNames::Win32::Security.get_account_right(canonicalize_username(new_config[:service_start_name])).include?(SERVICE_RIGHT) grant_service_logon(new_config[:service_start_name]) end |