summaryrefslogtreecommitdiff
path: root/lib/chef/win32/security
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-02-05 15:00:00 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-02-05 15:00:00 -0800
commit686113531d23f30e9973d659c456ae33eb9cff1f (patch)
treef225de7251a8b49b8d183dd168bab0a0addbe23f /lib/chef/win32/security
parentd1cf34b059a16a81e0fc48de52ba29863bb41fe6 (diff)
downloadchef-686113531d23f30e9973d659c456ae33eb9cff1f.tar.gz
autofixing whitespace cops
4174 Style/SpaceInsideHashLiteralBraces 1860 Style/SpaceAroundOperators 1336 Style/SpaceInsideBlockBraces 1292 Style/AlignHash 997 Style/SpaceAfterComma 860 Style/SpaceAroundEqualsInParameterDefault 310 Style/EmptyLines 294 Style/IndentationConsistency 267 Style/TrailingWhitespace 238 Style/ExtraSpacing 212 Style/SpaceBeforeBlockBraces 166 Style/MultilineOperationIndentation 144 Style/TrailingBlankLines 120 Style/EmptyLineBetweenDefs 101 Style/IndentationWidth 82 Style/SpaceAroundBlockParameters 40 Style/EmptyLinesAroundMethodBody 29 Style/EmptyLinesAroundAccessModifier 1 Style/RescueEnsureAlignment
Diffstat (limited to 'lib/chef/win32/security')
-rw-r--r--lib/chef/win32/security/acl.rb6
-rw-r--r--lib/chef/win32/security/sid.rb38
2 files changed, 41 insertions, 3 deletions
diff --git a/lib/chef/win32/security/acl.rb b/lib/chef/win32/security/acl.rb
index 86c6e05bd2..8a04987e44 100644
--- a/lib/chef/win32/security/acl.rb
+++ b/lib/chef/win32/security/acl.rb
@@ -34,7 +34,7 @@ class Chef
end
def self.create(aces)
- aces_size = aces.inject(0) { |sum,ace| sum + ace.size }
+ aces_size = aces.inject(0) { |sum, ace| sum + ace.size }
acl_size = align_dword(Chef::ReservedNames::Win32::API::Security::ACLStruct.size + aces_size) # What the heck is 94???
acl = Chef::ReservedNames::Win32::Security.initialize_acl(acl_size)
aces.each { |ace| Chef::ReservedNames::Win32::Security.add_ace(acl, ace) }
@@ -45,7 +45,7 @@ class Chef
def ==(other)
return false if length != other.length
- 0.upto(length-1) do |i|
+ 0.upto(length - 1) do |i|
return false if self[i] != other[i]
end
return true
@@ -64,7 +64,7 @@ class Chef
end
def each
- 0.upto(length-1) { |i| yield self[i] }
+ 0.upto(length - 1) { |i| yield self[i] }
end
def insert(index, *aces)
diff --git a/lib/chef/win32/security/sid.rb b/lib/chef/win32/security/sid.rb
index 0219aa6eb1..4d2d252dd3 100644
--- a/lib/chef/win32/security/sid.rb
+++ b/lib/chef/win32/security/sid.rb
@@ -80,111 +80,147 @@ class Chef
def self.Null
SID.from_string_sid("S-1-0")
end
+
def self.Nobody
SID.from_string_sid("S-1-0-0")
end
+
def self.World
SID.from_string_sid("S-1-1")
end
+
def self.Everyone
SID.from_string_sid("S-1-1-0")
end
+
def self.Local
SID.from_string_sid("S-1-2")
end
+
def self.Creator
SID.from_string_sid("S-1-3")
end
+
def self.CreatorOwner
SID.from_string_sid("S-1-3-0")
end
+
def self.CreatorGroup
SID.from_string_sid("S-1-3-1")
end
+
def self.CreatorOwnerServer
SID.from_string_sid("S-1-3-2")
end
+
def self.CreatorGroupServer
SID.from_string_sid("S-1-3-3")
end
+
def self.NonUnique
SID.from_string_sid("S-1-4")
end
+
def self.Nt
SID.from_string_sid("S-1-5")
end
+
def self.Dialup
SID.from_string_sid("S-1-5-1")
end
+
def self.Network
SID.from_string_sid("S-1-5-2")
end
+
def self.Batch
SID.from_string_sid("S-1-5-3")
end
+
def self.Interactive
SID.from_string_sid("S-1-5-4")
end
+
def self.Service
SID.from_string_sid("S-1-5-6")
end
+
def self.Anonymous
SID.from_string_sid("S-1-5-7")
end
+
def self.Proxy
SID.from_string_sid("S-1-5-8")
end
+
def self.EnterpriseDomainControllers
SID.from_string_sid("S-1-5-9")
end
+
def self.PrincipalSelf
SID.from_string_sid("S-1-5-10")
end
+
def self.AuthenticatedUsers
SID.from_string_sid("S-1-5-11")
end
+
def self.RestrictedCode
SID.from_string_sid("S-1-5-12")
end
+
def self.TerminalServerUsers
SID.from_string_sid("S-1-5-13")
end
+
def self.LocalSystem
SID.from_string_sid("S-1-5-18")
end
+
def self.NtLocal
SID.from_string_sid("S-1-5-19")
end
+
def self.NtNetwork
SID.from_string_sid("S-1-5-20")
end
+
def self.BuiltinAdministrators
SID.from_string_sid("S-1-5-32-544")
end
+
def self.BuiltinUsers
SID.from_string_sid("S-1-5-32-545")
end
+
def self.Guests
SID.from_string_sid("S-1-5-32-546")
end
+
def self.PowerUsers
SID.from_string_sid("S-1-5-32-547")
end
+
def self.AccountOperators
SID.from_string_sid("S-1-5-32-548")
end
+
def self.ServerOperators
SID.from_string_sid("S-1-5-32-549")
end
+
def self.PrintOperators
SID.from_string_sid("S-1-5-32-550")
end
+
def self.BackupOperators
SID.from_string_sid("S-1-5-32-551")
end
+
def self.Replicators
SID.from_string_sid("S-1-5-32-552")
end
+
def self.Administrators
SID.from_string_sid("S-1-5-32-544")
end
@@ -192,9 +228,11 @@ class Chef
def self.None
SID.from_account("#{::ENV['COMPUTERNAME']}\\None")
end
+
def self.Administrator
SID.from_account("#{::ENV['COMPUTERNAME']}\\#{SID.admin_account_name}")
end
+
def self.Guest
SID.from_account("#{::ENV['COMPUTERNAME']}\\Guest")
end