Module: Windows::Security
- Defined in:
- lib/windows/security.rb
Constant Summary collapse
- ACL_REVISION =
2- ACL_REVISION2 =
2- ACL_REVISION3 =
3- ACL_REVISION4 =
4- ALLOW_ACE_LENGTH =
62- DACL_SECURITY_INFORMATION =
4- SE_DACL_PRESENT =
4- SECURITY_DESCRIPTOR_MIN_LENGTH =
20- SECURITY_DESCRIPTOR_REVISION =
1- GENERIC_RIGHTS_MASK =
4026597376- GENERIC_RIGHTS_CHK =
4026531840- REST_RIGHTS_MASK =
2097151- AddAce =
Win32API.new('advapi32', 'AddAce', 'PLLLL', 'I')
- CopySid =
Win32API.new('advapi32', 'CopySid', 'LLP', 'I')
- ConvertSidToStringSid =
Win32API.new('advapi32', 'ConvertSidToStringSid', 'PL', 'I')
- ConvertSecurityDescriptorToStringSecurityDescriptor =
Win32API.new('advapi32', 'ConvertSecurityDescriptorToStringSecurityDescriptor', 'PLLPP', 'I')
- ConvertStringSecurityDescriptorToSecurityDescriptor =
Win32API.new('advapi32', 'ConvertStringSecurityDescriptorToSecurityDescriptor', 'PLPP', 'I')
- ConvertStringSidToSid =
Win32API.new('advapi32', 'ConvertStringSidToSid', 'PL', 'I')
- GetAce =
Win32API.new('advapi32', 'GetAce', 'LLP', 'I')
- GetFileSecurity =
Win32API.new('advapi32', 'GetFileSecurity', 'PLPLP', 'I')
- GetLengthSid =
Win32API.new('advapi32', 'GetLengthSid', 'P', 'L')
- GetSecurityDescriptorControl =
Win32API.new('advapi32', 'GetSecurityDescriptorControl', 'PPP', 'I')
- GetSecurityDescriptorDacl =
Win32API.new('advapi32', 'GetSecurityDescriptorDacl', 'PPPP', 'I')
- GetSecurityDescriptorGroup =
Win32API.new('advapi32', 'GetSecurityDescriptorGroup', 'PPI', 'I')
- GetSecurityDescriptorLength =
Win32API.new('advapi32', 'GetSecurityDescriptorLength', 'P', 'L')
- GetSecurityDescriptorOwner =
Win32API.new('advapi32', 'GetSecurityDescriptorOwner', 'PPI', 'I')
- GetSecurityDescriptorRMControl =
Win32API.new('advapi32', 'GetSecurityDescriptorRMControl', 'PP', 'L')
- GetSecurityDescriptorSacl =
Win32API.new('advapi32', 'GetSecurityDescriptorSacl', 'PIPI', 'I')
- InitializeAcl =
Win32API.new('advapi32', 'InitializeAcl', 'PLL', 'I')
- InitializeSecurityDescriptor =
Win32API.new('advapi32', 'InitializeSecurityDescriptor', 'PL', 'I')
- IsValidSecurityDescriptor =
Win32API.new('advapi32', 'IsValidSecurityDescriptor', 'P', 'I')
- LookupAccountName =
Win32API.new('advapi32', 'LookupAccountName', 'PPPPPPP', 'I')
- LookupAccountSid =
Win32API.new('advapi32', 'LookupAccountSid', 'PLPPPPP', 'I')
- SetFileSecurity =
Win32API.new('advapi32', 'SetFileSecurity', 'PPP', 'I')
- SetSecurityDescriptorDacl =
Win32API.new('advapi32', 'SetSecurityDescriptorDacl', 'PIPI', 'I')
- SetSecurityDescriptorGroup =
Win32API.new('advapi32', 'SetSecurityDescriptorGroup', 'PPI', 'I')
- SetSecurityDescriptorOwner =
Win32API.new('advapi32', 'SetSecurityDescriptorOwner', 'PPI', 'I')
- SetSecurityDescriptorRMControl =
Win32API.new('advapi32', 'SetSecurityDescriptorRMControl', 'PP', 'L')
- SetSecurityDescriptorSacl =
Win32API.new('advapi32', 'SetSecurityDescriptorSacl', 'PIPI', 'I')
Instance Method Summary collapse
- #AddAce(acl, rev, index, list, length) ⇒ Object
- #ConvertSecurityDescriptorToStringSecurityDescriptor(sid, revision, info, desc, desc_length) ⇒ Object
- #ConvertSidToStringSid(sid, buf) ⇒ Object
- #ConvertStringSecurityDescriptorToSecurityDescriptor(sid, revision, desc, desc_length) ⇒ Object
- #ConvertStringSidToSid(string, sid) ⇒ Object
- #CopySid(sid_length, sid_buf, sid_source) ⇒ Object
- #GetAce(acl, index, ace) ⇒ Object
- #GetFileSecurity(file, info, descriptor, length, nlength) ⇒ Object
- #GetLengthSid(sid) ⇒ Object
- #GetSecurityDescriptorControl(descriptor, control, revision) ⇒ Object
- #GetSecurityDescriptorDacl(descriptor, dacl_present, dacl, default) ⇒ Object
- #GetSecurityDescriptorGroup(descriptor, group, default) ⇒ Object
- #GetSecurityDescriptorLength(descriptor) ⇒ Object
- #GetSecurityDescriptorOwner(descriptor, owner, default) ⇒ Object
- #GetSecurityDescriptorRMControl(descriptor, control) ⇒ Object
- #GetSecurityDescriptorSacl(descriptor, present, sacl, default) ⇒ Object
- #InitializeAcl(acl, length, revision = ACL_REVISION) ⇒ Object
- #InitializeSecurityDescriptor(descriptor, revision = SECURITY_DESCRIPTOR_REVISION) ⇒ Object
- #IsValidSecurityDescriptor(descriptor) ⇒ Object
- #LookupAccountName(sys, name, sid, sid_size, domain, domain_size, use) ⇒ Object
- #LookupAccountSid(sys, sid, name, name_size, domain, domain_size, use) ⇒ Object
- #SetFileSecurity(file, info, descriptor) ⇒ Object
- #SetSecurityDescriptorDacl(descriptor, present, dacl, default) ⇒ Object
- #SetSecurityDescriptorGroup(descriptor, group, default) ⇒ Object
- #SetSecurityDescriptorOwner(descriptor, owner, default) ⇒ Object
- #SetSecurityDescriptorRMControl(descriptor, control) ⇒ Object
- #SetSecurityDescriptorSacl(descriptor, present, sacl, default) ⇒ Object
Instance Method Details
#AddAce(acl, rev, index, list, length) ⇒ Object
53 54 55 |
# File 'lib/windows/security.rb', line 53 def AddAce(acl, rev, index, list, length) AddAce.call(acl, rev, index, list, length) != 0 end |
#ConvertSecurityDescriptorToStringSecurityDescriptor(sid, revision, info, desc, desc_length) ⇒ Object
65 66 67 |
# File 'lib/windows/security.rb', line 65 def ConvertSecurityDescriptorToStringSecurityDescriptor(sid, revision, info, desc, desc_length) ConvertSecurityDescriptorToStringSecurityDescriptor.call(sid, revision, info, desc, desc_length).call != 0 end |
#ConvertSidToStringSid(sid, buf) ⇒ Object
61 62 63 |
# File 'lib/windows/security.rb', line 61 def ConvertSidToStringSid(sid, buf) ConvertSidToStringSid.call(sid, buf) != 0 end |
#ConvertStringSecurityDescriptorToSecurityDescriptor(sid, revision, desc, desc_length) ⇒ Object
69 70 71 |
# File 'lib/windows/security.rb', line 69 def ConvertStringSecurityDescriptorToSecurityDescriptor(sid, revision, desc, desc_length) ConvertStringSecurityDescriptorToSecurityDescriptor.call(sid, revision, desc, desc_length) != 0 end |
#ConvertStringSidToSid(string, sid) ⇒ Object
73 74 75 |
# File 'lib/windows/security.rb', line 73 def ConvertStringSidToSid(string, sid) ConvertStringSidToSid.call(string, sid) != 0 end |
#CopySid(sid_length, sid_buf, sid_source) ⇒ Object
57 58 59 |
# File 'lib/windows/security.rb', line 57 def CopySid(sid_length, sid_buf, sid_source) CopySid.call(sid_length, sid_buf, sid_source) != 0 end |
#GetAce(acl, index, ace) ⇒ Object
77 78 79 |
# File 'lib/windows/security.rb', line 77 def GetAce(acl, index, ace) GetAce.call(acl, index, ace) != 0 end |
#GetFileSecurity(file, info, descriptor, length, nlength) ⇒ Object
81 82 83 |
# File 'lib/windows/security.rb', line 81 def GetFileSecurity(file, info, descriptor, length, nlength) GetFileSecurity.call(file, info, descriptor, length, nlength) != 0 end |
#GetLengthSid(sid) ⇒ Object
85 86 87 |
# File 'lib/windows/security.rb', line 85 def GetLengthSid(sid) GetLengthSid.call(sid) end |
#GetSecurityDescriptorControl(descriptor, control, revision) ⇒ Object
89 90 91 |
# File 'lib/windows/security.rb', line 89 def GetSecurityDescriptorControl(descriptor, control, revision) GetSecurityDescriptorControl.call(descriptor, control, revision) != 0 end |
#GetSecurityDescriptorDacl(descriptor, dacl_present, dacl, default) ⇒ Object
93 94 95 |
# File 'lib/windows/security.rb', line 93 def GetSecurityDescriptorDacl(descriptor, dacl_present, dacl, default) GetSecurityDescriptorDacl.call(descriptor, dacl_present, dacl, default) != 0 end |
#GetSecurityDescriptorGroup(descriptor, group, default) ⇒ Object
97 98 99 |
# File 'lib/windows/security.rb', line 97 def GetSecurityDescriptorGroup(descriptor, group, default) GetSecurityDescriptorGroup.call(descriptor, group, default) != 0 end |
#GetSecurityDescriptorLength(descriptor) ⇒ Object
101 102 103 |
# File 'lib/windows/security.rb', line 101 def GetSecurityDescriptorLength(descriptor) GetSecurityDescriptorLength.call(descriptor) end |
#GetSecurityDescriptorOwner(descriptor, owner, default) ⇒ Object
105 106 107 |
# File 'lib/windows/security.rb', line 105 def GetSecurityDescriptorOwner(descriptor, owner, default) GetSecurityDescriptorOwner.call(descriptor, owner, default) != 0 end |
#GetSecurityDescriptorRMControl(descriptor, control) ⇒ Object
109 110 111 |
# File 'lib/windows/security.rb', line 109 def GetSecurityDescriptorRMControl(descriptor, control) GetSecurityDescriptorRMControl.call(descriptor, control) end |
#GetSecurityDescriptorSacl(descriptor, present, sacl, default) ⇒ Object
113 114 115 |
# File 'lib/windows/security.rb', line 113 def GetSecurityDescriptorSacl(descriptor, present, sacl, default) GetSecurityDescriptorSacl.call(descriptor, present, sacl, default) != 0 end |
#InitializeAcl(acl, length, revision = ACL_REVISION) ⇒ Object
117 118 119 |
# File 'lib/windows/security.rb', line 117 def InitializeAcl(acl, length, revision = ACL_REVISION) InitializeAcl.call(acl, length, revision) != 0 end |
#InitializeSecurityDescriptor(descriptor, revision = SECURITY_DESCRIPTOR_REVISION) ⇒ Object
121 122 123 |
# File 'lib/windows/security.rb', line 121 def InitializeSecurityDescriptor(descriptor, revision = SECURITY_DESCRIPTOR_REVISION) InitializeSecurityDescriptor.call(descriptor, revision) != 0 end |
#IsValidSecurityDescriptor(descriptor) ⇒ Object
125 126 127 |
# File 'lib/windows/security.rb', line 125 def IsValidSecurityDescriptor(descriptor) IsValidSecurityDescriptor.call(descriptor) != 0 end |
#LookupAccountName(sys, name, sid, sid_size, domain, domain_size, use) ⇒ Object
129 130 131 |
# File 'lib/windows/security.rb', line 129 def LookupAccountName(sys, name, sid, sid_size, domain, domain_size, use) LookupAccountName.call(sys, name, sid, sid_size, domain, domain_size, use) != 0 end |
#LookupAccountSid(sys, sid, name, name_size, domain, domain_size, use) ⇒ Object
133 134 135 |
# File 'lib/windows/security.rb', line 133 def LookupAccountSid(sys, sid, name, name_size, domain, domain_size, use) LookupAccountSid.call(sys, sid, name, name_size, domain, domain_size, use) != 0 end |
#SetFileSecurity(file, info, descriptor) ⇒ Object
137 138 139 |
# File 'lib/windows/security.rb', line 137 def SetFileSecurity(file, info, descriptor) SetFileSecurity.call(file, info, descriptor) != 0 end |
#SetSecurityDescriptorDacl(descriptor, present, dacl, default) ⇒ Object
141 142 143 |
# File 'lib/windows/security.rb', line 141 def SetSecurityDescriptorDacl(descriptor, present, dacl, default) SetSecurityDescriptorDacl.call(descriptor, present, dacl, default) != 0 end |
#SetSecurityDescriptorGroup(descriptor, group, default) ⇒ Object
145 146 147 |
# File 'lib/windows/security.rb', line 145 def SetSecurityDescriptorGroup(descriptor, group, default) SetSecurityDescriptorGroup.call(descriptor, group, default) != 0 end |
#SetSecurityDescriptorOwner(descriptor, owner, default) ⇒ Object
149 150 151 |
# File 'lib/windows/security.rb', line 149 def SetSecurityDescriptorOwner(descriptor, owner, default) SetSecurityDescriptorOwner.call(descriptor, owner, default) != 0 end |
#SetSecurityDescriptorRMControl(descriptor, control) ⇒ Object
153 154 155 |
# File 'lib/windows/security.rb', line 153 def SetSecurityDescriptorRMControl(descriptor, control) SetSecurityDescriptorRMControl.call(descriptor, control) end |
#SetSecurityDescriptorSacl(descriptor, present, sacl, default) ⇒ Object
157 158 159 |
# File 'lib/windows/security.rb', line 157 def SetSecurityDescriptorSacl(descriptor, present, sacl, default) SetSecurityDescriptorSacl.call(descriptor, present, sacl, default) != 0 end |