Class: Chef::ReservedNames::Win32::Security::SID
- Defined in:
- lib/chef/win32/security/sid.rb
Instance Attribute Summary collapse
-
#pointer ⇒ Object
readonly
Returns the value of attribute pointer.
Class Method Summary collapse
- .AccountOperators ⇒ Object
- .Administrator ⇒ Object
- .Administrators ⇒ Object
- .Anonymous ⇒ Object
- .AuthenticatedUsers ⇒ Object
- .BackupOperators ⇒ Object
- .Batch ⇒ Object
- .BuiltinAdministrators ⇒ Object
- .BuiltinUsers ⇒ Object
- .Creator ⇒ Object
- .CreatorGroup ⇒ Object
- .CreatorGroupServer ⇒ Object
- .CreatorOwner ⇒ Object
- .CreatorOwnerServer ⇒ Object
- .current_user ⇒ Object
- .Dialup ⇒ Object
- .EnterpriseDomainControllers ⇒ Object
- .Everyone ⇒ Object
- .from_account(name) ⇒ Object
- .from_string_sid(string_sid) ⇒ Object
- .Guest ⇒ Object
- .Guests ⇒ Object
- .Interactive ⇒ Object
- .Local ⇒ Object
- .LocalSystem ⇒ Object
- .Network ⇒ Object
- .Nobody ⇒ Object
-
.None ⇒ Object
Machine-specific, well-known SIDs TODO: don’t use strings, dummy.
- .NonUnique ⇒ Object
- .Nt ⇒ Object
- .NtLocal ⇒ Object
- .NtNetwork ⇒ Object
-
.Null ⇒ Object
Well-known SIDs.
- .PowerUsers ⇒ Object
- .PrincipalSelf ⇒ Object
- .PrintOperators ⇒ Object
- .Proxy ⇒ Object
- .Replicators ⇒ Object
- .RestrictedCode ⇒ Object
- .ServerOperators ⇒ Object
- .Service ⇒ Object
- .TerminalServerUsers ⇒ Object
- .World ⇒ Object
Instance Method Summary collapse
- #==(other) ⇒ Object
- #account ⇒ Object
- #account_name ⇒ Object
-
#initialize(pointer, owner = nil) ⇒ SID
constructor
A new instance of SID.
- #size ⇒ Object
- #to_s ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(pointer, owner = nil) ⇒ SID
Returns a new instance of SID.
26 27 28 29 30 |
# File 'lib/chef/win32/security/sid.rb', line 26 def initialize(pointer, owner = nil) @pointer = pointer # Keep a reference to the actual owner of this memory so we don't get freed @owner = owner end |
Instance Attribute Details
#pointer ⇒ Object (readonly)
Returns the value of attribute pointer.
45 46 47 |
# File 'lib/chef/win32/security/sid.rb', line 45 def pointer @pointer end |
Class Method Details
.AccountOperators ⇒ Object
162 163 164 |
# File 'lib/chef/win32/security/sid.rb', line 162 def self.AccountOperators SID.from_string_sid('S-1-5-32-548') end |
.Administrator ⇒ Object
186 187 188 |
# File 'lib/chef/win32/security/sid.rb', line 186 def self.Administrator SID.from_account("#{::ENV['COMPUTERNAME']}\\Administrator") end |
.Administrators ⇒ Object
177 178 179 |
# File 'lib/chef/win32/security/sid.rb', line 177 def self.Administrators SID.from_string_sid('S-1-5-32-544') end |
.Anonymous ⇒ Object
120 121 122 |
# File 'lib/chef/win32/security/sid.rb', line 120 def self.Anonymous SID.from_string_sid('S-1-5-7') end |
.AuthenticatedUsers ⇒ Object
132 133 134 |
# File 'lib/chef/win32/security/sid.rb', line 132 def self.AuthenticatedUsers SID.from_string_sid('S-1-5-11') end |
.BackupOperators ⇒ Object
171 172 173 |
# File 'lib/chef/win32/security/sid.rb', line 171 def self.BackupOperators SID.from_string_sid('S-1-5-32-551') end |
.Batch ⇒ Object
111 112 113 |
# File 'lib/chef/win32/security/sid.rb', line 111 def self.Batch SID.from_string_sid('S-1-5-3') end |
.BuiltinAdministrators ⇒ Object
150 151 152 |
# File 'lib/chef/win32/security/sid.rb', line 150 def self.BuiltinAdministrators SID.from_string_sid('S-1-5-32-544') end |
.BuiltinUsers ⇒ Object
153 154 155 |
# File 'lib/chef/win32/security/sid.rb', line 153 def self.BuiltinUsers SID.from_string_sid('S-1-5-32-545') end |
.Creator ⇒ Object
84 85 86 |
# File 'lib/chef/win32/security/sid.rb', line 84 def self.Creator SID.from_string_sid('S-1-3') end |
.CreatorGroup ⇒ Object
90 91 92 |
# File 'lib/chef/win32/security/sid.rb', line 90 def self.CreatorGroup SID.from_string_sid('S-1-3-1') end |
.CreatorGroupServer ⇒ Object
96 97 98 |
# File 'lib/chef/win32/security/sid.rb', line 96 def self.CreatorGroupServer SID.from_string_sid('S-1-3-3') end |
.CreatorOwner ⇒ Object
87 88 89 |
# File 'lib/chef/win32/security/sid.rb', line 87 def self.CreatorOwner SID.from_string_sid('S-1-3-0') end |
.CreatorOwnerServer ⇒ Object
93 94 95 |
# File 'lib/chef/win32/security/sid.rb', line 93 def self.CreatorOwnerServer SID.from_string_sid('S-1-3-2') end |
.current_user ⇒ Object
193 194 195 |
# File 'lib/chef/win32/security/sid.rb', line 193 def self.current_user SID.from_account("#{::ENV['USERDOMAIN']}\\#{::ENV['USERNAME']}") end |
.Dialup ⇒ Object
105 106 107 |
# File 'lib/chef/win32/security/sid.rb', line 105 def self.Dialup SID.from_string_sid('S-1-5-1') end |
.EnterpriseDomainControllers ⇒ Object
126 127 128 |
# File 'lib/chef/win32/security/sid.rb', line 126 def self.EnterpriseDomainControllers SID.from_string_sid('S-1-5-9') end |
.Everyone ⇒ Object
78 79 80 |
# File 'lib/chef/win32/security/sid.rb', line 78 def self.Everyone SID.from_string_sid('S-1-1-0') end |
.from_account(name) ⇒ Object
32 33 34 35 |
# File 'lib/chef/win32/security/sid.rb', line 32 def self.from_account(name) domain, sid, use = Chef::ReservedNames::Win32::Security.lookup_account_name(name) sid end |
.from_string_sid(string_sid) ⇒ Object
37 38 39 |
# File 'lib/chef/win32/security/sid.rb', line 37 def self.from_string_sid(string_sid) Chef::ReservedNames::Win32::Security::convert_string_sid_to_sid(string_sid) end |
.Guest ⇒ Object
189 190 191 |
# File 'lib/chef/win32/security/sid.rb', line 189 def self.Guest SID.from_account("#{::ENV['COMPUTERNAME']}\\Guest") end |
.Guests ⇒ Object
156 157 158 |
# File 'lib/chef/win32/security/sid.rb', line 156 def self.Guests SID.from_string_sid('S-1-5-32-546') end |
.Interactive ⇒ Object
114 115 116 |
# File 'lib/chef/win32/security/sid.rb', line 114 def self.Interactive SID.from_string_sid('S-1-5-4') end |
.Local ⇒ Object
81 82 83 |
# File 'lib/chef/win32/security/sid.rb', line 81 def self.Local SID.from_string_sid('S-1-2') end |
.LocalSystem ⇒ Object
141 142 143 |
# File 'lib/chef/win32/security/sid.rb', line 141 def self.LocalSystem SID.from_string_sid('S-1-5-18') end |
.Network ⇒ Object
108 109 110 |
# File 'lib/chef/win32/security/sid.rb', line 108 def self.Network SID.from_string_sid('S-1-5-2') end |
.Nobody ⇒ Object
72 73 74 |
# File 'lib/chef/win32/security/sid.rb', line 72 def self.Nobody SID.from_string_sid('S-1-0-0') end |
.None ⇒ Object
Machine-specific, well-known SIDs TODO: don’t use strings, dummy
183 184 185 |
# File 'lib/chef/win32/security/sid.rb', line 183 def self.None SID.from_account("#{::ENV['COMPUTERNAME']}\\None") end |
.NonUnique ⇒ Object
99 100 101 |
# File 'lib/chef/win32/security/sid.rb', line 99 def self.NonUnique SID.from_string_sid('S-1-4') end |
.Nt ⇒ Object
102 103 104 |
# File 'lib/chef/win32/security/sid.rb', line 102 def self.Nt SID.from_string_sid('S-1-5') end |
.NtLocal ⇒ Object
144 145 146 |
# File 'lib/chef/win32/security/sid.rb', line 144 def self.NtLocal SID.from_string_sid('S-1-5-19') end |
.NtNetwork ⇒ Object
147 148 149 |
# File 'lib/chef/win32/security/sid.rb', line 147 def self.NtNetwork SID.from_string_sid('S-1-5-20') end |
.Null ⇒ Object
Well-known SIDs
69 70 71 |
# File 'lib/chef/win32/security/sid.rb', line 69 def self.Null SID.from_string_sid('S-1-0') end |
.PowerUsers ⇒ Object
159 160 161 |
# File 'lib/chef/win32/security/sid.rb', line 159 def self.PowerUsers SID.from_string_sid('S-1-5-32-547') end |
.PrincipalSelf ⇒ Object
129 130 131 |
# File 'lib/chef/win32/security/sid.rb', line 129 def self.PrincipalSelf SID.from_string_sid('S-1-5-10') end |
.PrintOperators ⇒ Object
168 169 170 |
# File 'lib/chef/win32/security/sid.rb', line 168 def self.PrintOperators SID.from_string_sid('S-1-5-32-550') end |
.Proxy ⇒ Object
123 124 125 |
# File 'lib/chef/win32/security/sid.rb', line 123 def self.Proxy SID.from_string_sid('S-1-5-8') end |
.Replicators ⇒ Object
174 175 176 |
# File 'lib/chef/win32/security/sid.rb', line 174 def self.Replicators SID.from_string_sid('S-1-5-32-552') end |
.RestrictedCode ⇒ Object
135 136 137 |
# File 'lib/chef/win32/security/sid.rb', line 135 def self.RestrictedCode SID.from_string_sid('S-1-5-12') end |
.ServerOperators ⇒ Object
165 166 167 |
# File 'lib/chef/win32/security/sid.rb', line 165 def self.ServerOperators SID.from_string_sid('S-1-5-32-549') end |
.Service ⇒ Object
117 118 119 |
# File 'lib/chef/win32/security/sid.rb', line 117 def self.Service SID.from_string_sid('S-1-5-6') end |
.TerminalServerUsers ⇒ Object
138 139 140 |
# File 'lib/chef/win32/security/sid.rb', line 138 def self.TerminalServerUsers SID.from_string_sid('S-1-5-13') end |
.World ⇒ Object
75 76 77 |
# File 'lib/chef/win32/security/sid.rb', line 75 def self.World SID.from_string_sid('S-1-1') end |
Instance Method Details
#==(other) ⇒ Object
41 42 43 |
# File 'lib/chef/win32/security/sid.rb', line 41 def ==(other) other != nil && Chef::ReservedNames::Win32::Security.equal_sid(self, other) end |
#account ⇒ Object
47 48 49 |
# File 'lib/chef/win32/security/sid.rb', line 47 def account Chef::ReservedNames::Win32::Security.lookup_account_sid(self) end |
#account_name ⇒ Object
51 52 53 54 |
# File 'lib/chef/win32/security/sid.rb', line 51 def account_name domain, name, use = account (domain != nil && domain.length > 0) ? "#{domain}\\#{name}" : name end |
#size ⇒ Object
56 57 58 |
# File 'lib/chef/win32/security/sid.rb', line 56 def size Chef::ReservedNames::Win32::Security.get_length_sid(self) end |
#to_s ⇒ Object
60 61 62 |
# File 'lib/chef/win32/security/sid.rb', line 60 def to_s Chef::ReservedNames::Win32::Security.convert_sid_to_string_sid(self) end |
#valid? ⇒ Boolean
64 65 66 |
# File 'lib/chef/win32/security/sid.rb', line 64 def valid? Chef::ReservedNames::Win32::Security.is_valid_sid(self) end |