SecDesc
Windows security descriptor.
A descriptor can also be written as a
SecDescSpec wherever one is accepted.
ACL-related fields raise FieldError when the corresponding ACL was not
loaded.
Constructor
SecDesc packet
Parses a self-relative security descriptor packet.
Parameters
| Name | Type | Description |
|---|---|---|
packet |
Bin |
Native self-relative packet. |
Errors
ValueError if the packet is malformed or not self-relative.
SecDesc …
Constructs a security descriptor from built components and control flags.
A control flag given as true requires its component to be present or
given.
Parameters
| Name | Type | Description |
|---|---|---|
:owner? |
(Sid | nil) |
Owner, or nil for an absent owner. |
:group? |
(Sid | nil) |
Primary group, or nil for an absent group. |
:dacl? |
(Acl | nil) |
Discretionary ACL, or nil for a present null ACL. |
:sacl? |
(Acl | nil) |
System ACL, or nil for a present null ACL. |
:owner_defaulted? |
Bool |
Owner defaulted flag. |
:group_defaulted? |
Bool |
Group defaulted flag. |
:dacl_present? |
Bool |
DACL presence. |
:dacl_defaulted? |
Bool |
DACL defaulted flag. |
:dacl_auto_inherit_required? |
Bool |
DACL inheritance request. |
:dacl_auto_inherited? |
Bool |
DACL inherited flag. |
:dacl_protected? |
Bool |
DACL protection. |
:sacl_present? |
Bool |
SACL presence. |
:sacl_defaulted? |
Bool |
SACL defaulted flag. |
:sacl_auto_inherit_required? |
Bool |
SACL inheritance request. |
:sacl_auto_inherited? |
Bool |
SACL inherited flag. |
:sacl_protected? |
Bool |
SACL protection. |
:rm_control? |
Int |
Resource-manager control byte. |
Fields
control @ SecDescControlThe control flags, excluding the self-relative storage flag.
dacl @ (Acl | nil)The discretionary ACL, or
nilfor a present null ACL.Raises
FieldErrorwhen the DACL was not loaded or is not present.dacl_auto_inherit_required @ BoolWhether DACL inheritance computation was requested.
dacl_auto_inherited @ BoolWhether the DACL was produced through inheritance.
dacl_defaulted @ BoolWhether the DACL was supplied by a default mechanism.
dacl_present @ BoolWhether the DACL is present. A present ACL can be null.
dacl_protected @ BoolWhether the DACL is protected from inheritance.
group @ SidThe primary group.
Raises
FieldErrorwhen the group was not loaded or is absent.group_defaulted @ BoolWhether the group was supplied by a default mechanism.
mask @ SecInfoThe components that are present.
A descriptor parsed from a self-relative packet has all four components marked, because the packet carries no separate mask. One read from an object may have fewer, depending on what was queried.
owner @ SidThe owner.
Raises
FieldErrorwhen the owner was not loaded or is absent.owner_defaulted @ BoolWhether the owner was supplied by a default mechanism.
revision @ IntSecurity descriptor revision.
rm_control @ IntResource-manager-defined control byte.
Raises
FieldErrorwhenrm_control_validis false.rm_control_valid @ BoolWhether the resource-manager control byte is valid.
sacl @ (Acl | nil)The system ACL, or
nilfor a present null ACL.Raises
FieldErrorwhen the SACL was not loaded or is not present.sacl_auto_inherit_required @ BoolWhether SACL inheritance computation was requested.
sacl_auto_inherited @ BoolWhether the SACL was produced through inheritance.
sacl_defaulted @ BoolWhether the SACL was supplied by a default mechanism.
sacl_present @ BoolWhether the SACL is present. A present ACL can be null.
sacl_protected @ BoolWhether the SACL is protected from inheritance.
Methods
to_bin() -> Bin
Returns a canonical self-relative security descriptor packet.
with … -> SecDesc
Returns a descriptor with the given components or control flags replaced.
Components are strict, as for the constructor. An ACL presence flag given
as false clears that ACL.
Parameters
| Name | Type | Description |
|---|---|---|
:owner? |
(Sid | nil) |
Owner, or nil for an absent owner. |
:group? |
(Sid | nil) |
Primary group, or nil for an absent group. |
:dacl? |
(Acl | nil) |
Discretionary ACL, or nil for a present null ACL. |
:sacl? |
(Acl | nil) |
System ACL, or nil for a present null ACL. |
:owner_defaulted? |
Bool |
Owner defaulted flag. |
:group_defaulted? |
Bool |
Group defaulted flag. |
:dacl_present? |
Bool |
DACL presence. |
:dacl_defaulted? |
Bool |
DACL defaulted flag. |
:dacl_auto_inherit_required? |
Bool |
DACL inheritance request. |
:dacl_auto_inherited? |
Bool |
DACL inherited flag. |
:dacl_protected? |
Bool |
DACL protection. |
:sacl_present? |
Bool |
SACL presence. |
:sacl_defaulted? |
Bool |
SACL defaulted flag. |
:sacl_auto_inherit_required? |
Bool |
SACL inheritance request. |
:sacl_auto_inherited? |
Bool |
SACL inherited flag. |
:sacl_protected? |
Bool |
SACL protection. |
:rm_control? |
(Int | nil) |
Resource-manager control byte, or nil to clear it. |