diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-02 15:09:07 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-02 15:09:07 -0700 |
commit | 7a1a6c8ef26c787e4b6dd1602f3d158b37e81720 (patch) | |
tree | 1e390cd535b38368d091cbb33e5d419408d5ce00 /lib/chef/win32/security | |
parent | 77f8739a4741e2370e40ec39345a92a6ea393a1a (diff) | |
download | chef-7a1a6c8ef26c787e4b6dd1602f3d158b37e81720.tar.gz |
fix Layout/EmptyLineAfterGuardClause
i like this one, gives visual priority to returns or raises that are
buried in the middle of things.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/win32/security')
-rw-r--r-- | lib/chef/win32/security/acl.rb | 1 | ||||
-rw-r--r-- | lib/chef/win32/security/security_descriptor.rb | 2 | ||||
-rw-r--r-- | lib/chef/win32/security/sid.rb | 1 | ||||
-rw-r--r-- | lib/chef/win32/security/token.rb | 1 |
4 files changed, 5 insertions, 0 deletions
diff --git a/lib/chef/win32/security/acl.rb b/lib/chef/win32/security/acl.rb index a2700b36ac..548194fb7d 100644 --- a/lib/chef/win32/security/acl.rb +++ b/lib/chef/win32/security/acl.rb @@ -45,6 +45,7 @@ class Chef def ==(other) return false if length != other.length + 0.upto(length - 1) do |i| return false if self[i] != other[i] end diff --git a/lib/chef/win32/security/security_descriptor.rb b/lib/chef/win32/security/security_descriptor.rb index 83f5c466aa..722d8faf5d 100644 --- a/lib/chef/win32/security/security_descriptor.rb +++ b/lib/chef/win32/security/security_descriptor.rb @@ -42,6 +42,7 @@ class Chef def dacl raise "DACL not present" if !dacl_present? + present, acl, defaulted = Chef::ReservedNames::Win32::Security.get_security_descriptor_dacl(self) acl end @@ -66,6 +67,7 @@ class Chef def sacl raise "SACL not present" if !sacl_present? + Security.with_privileges("SeSecurityPrivilege") do present, acl, defaulted = Chef::ReservedNames::Win32::Security.get_security_descriptor_sacl(self) acl diff --git a/lib/chef/win32/security/sid.rb b/lib/chef/win32/security/sid.rb index 4d34f8b8a7..0d1a9138ae 100644 --- a/lib/chef/win32/security/sid.rb +++ b/lib/chef/win32/security/sid.rb @@ -338,6 +338,7 @@ class Chef end raise "Can not determine the administrator account name." if admin_account_name.nil? + admin_account_name end end diff --git a/lib/chef/win32/security/token.rb b/lib/chef/win32/security/token.rb index dfd1e31241..5710d896b7 100644 --- a/lib/chef/win32/security/token.rb +++ b/lib/chef/win32/security/token.rb @@ -64,6 +64,7 @@ class Chef unless Chef::ReservedNames::Win32::API::Security.DuplicateToken(handle.handle, security_impersonation_level, duplicate_token_handle) raise Chef::ReservedNames::Win32::Error.raise! end + Token.new(Handle.new(duplicate_token_handle.read_ulong)) end end |