control

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const (
	NT_SECURITY_DESCRIPTOR_CONTROL_SR uint16 = 0x0001 // Self-Relative
	NT_SECURITY_DESCRIPTOR_CONTROL_RM uint16 = 0x0002 // RM Control Valid
	NT_SECURITY_DESCRIPTOR_CONTROL_PS uint16 = 0x0004 // SACL Protected
	NT_SECURITY_DESCRIPTOR_CONTROL_PD uint16 = 0x0008 // DACL Protected
	NT_SECURITY_DESCRIPTOR_CONTROL_SI uint16 = 0x0010 // SACL Auto-Inherited
	NT_SECURITY_DESCRIPTOR_CONTROL_DI uint16 = 0x0020 // DACL Auto-Inherited
	NT_SECURITY_DESCRIPTOR_CONTROL_SC uint16 = 0x0040 // SACL Computed Inheritance Required
	NT_SECURITY_DESCRIPTOR_CONTROL_DC uint16 = 0x0080 // DACL Computed Inheritance Required
	NT_SECURITY_DESCRIPTOR_CONTROL_SS uint16 = 0x0100 // Server Security
	NT_SECURITY_DESCRIPTOR_CONTROL_DT uint16 = 0x0200 // DACL Trusted
	NT_SECURITY_DESCRIPTOR_CONTROL_SD uint16 = 0x0400 // SACL Defaulted
	NT_SECURITY_DESCRIPTOR_CONTROL_SP uint16 = 0x0800 // SACL Present
	NT_SECURITY_DESCRIPTOR_CONTROL_DD uint16 = 0x1000 // DACL Defaulted
	NT_SECURITY_DESCRIPTOR_CONTROL_DP uint16 = 0x2000 // DACL Present
	NT_SECURITY_DESCRIPTOR_CONTROL_GD uint16 = 0x4000 // Group Defaulted
	NT_SECURITY_DESCRIPTOR_CONTROL_OD uint16 = 0x8000 // Owner Defaulted
)

Control indexes in bit field

Variables

View Source
var NtSecurityDescriptorControlValueToName = map[uint16]string{
	NT_SECURITY_DESCRIPTOR_CONTROL_SR: "Self-Relative",
	NT_SECURITY_DESCRIPTOR_CONTROL_RM: "RM Control Valid",
	NT_SECURITY_DESCRIPTOR_CONTROL_PS: "SACL Protected",
	NT_SECURITY_DESCRIPTOR_CONTROL_PD: "DACL Protected",
	NT_SECURITY_DESCRIPTOR_CONTROL_SI: "SACL Auto-Inherited",
	NT_SECURITY_DESCRIPTOR_CONTROL_DI: "DACL Auto-Inherited",
	NT_SECURITY_DESCRIPTOR_CONTROL_SC: "SACL Computed Inheritance Required",
	NT_SECURITY_DESCRIPTOR_CONTROL_DC: "DACL Computed Inheritance Required",
	NT_SECURITY_DESCRIPTOR_CONTROL_SS: "Server Security",
	NT_SECURITY_DESCRIPTOR_CONTROL_DT: "DACL Trusted",
	NT_SECURITY_DESCRIPTOR_CONTROL_SD: "SACL Defaulted",
	NT_SECURITY_DESCRIPTOR_CONTROL_SP: "SACL Present",
	NT_SECURITY_DESCRIPTOR_CONTROL_DD: "DACL Defaulted",
	NT_SECURITY_DESCRIPTOR_CONTROL_DP: "DACL Present",
	NT_SECURITY_DESCRIPTOR_CONTROL_GD: "Group Defaulted",
	NT_SECURITY_DESCRIPTOR_CONTROL_OD: "Owner Defaulted",
}

Control flag map from value to string representation

Control flag map from value to string representation

Functions

This section is empty.

Types

type NtSecurityDescriptorControl

type NtSecurityDescriptorControl struct {
	RawValue uint16
	Values   []uint16
	Flags    []string
}

NtSecurityDescriptorControl represents the control flags for a NT Security Descriptor. The fields are defined as constants to represent their bit positions.

func (*NtSecurityDescriptorControl) AddControl

func (nsdc *NtSecurityDescriptorControl) AddControl(control uint16) bool

AddControl adds a specific control bit to the RawValue.

Parameters:

  • control (uint16): The control flag to add (NT_SECURITY_DESCRIPTOR_CONTROL_*).

Returns:

  • bool: True if the control was added, false if it was already present.

func (*NtSecurityDescriptorControl) ClearControls

func (nsdc *NtSecurityDescriptorControl) ClearControls()

ClearControls removes all control bits from the RawValue and clears the Values and Flags slices.

func (*NtSecurityDescriptorControl) Equal

Equal compares two NtSecurityDescriptorControl instances for equality.

Parameters:

  • other (*NtSecurityDescriptorControl): The NtSecurityDescriptorControl to compare with.

Returns:

  • bool: True if the NtSecurityDescriptorControls are equal, false otherwise.

func (*NtSecurityDescriptorControl) HasControl

func (nsdc *NtSecurityDescriptorControl) HasControl(control uint16) bool

HasControl checks if a specific control bit is set in the RawValue. Parameters:

  • control (uint16): The control flag to check (NT_SECURITY_DESCRIPTOR_CONTROL_*).

Returns:

  • bool: True if the specified control bit is set, false otherwise.

func (*NtSecurityDescriptorControl) Marshal

func (nsdc *NtSecurityDescriptorControl) Marshal() ([]byte, error)

Marshal serializes the NtSecurityDescriptorControl struct into a byte slice.

Returns:

  • []byte: The serialized byte slice representing the security descriptor control.

func (*NtSecurityDescriptorControl) RemoveControl

func (nsdc *NtSecurityDescriptorControl) RemoveControl(control uint16) bool

RemoveControl removes a specific control bit from the RawValue.

Parameters:

  • control (uint16): The control flag to remove (NT_SECURITY_DESCRIPTOR_CONTROL_*).

Returns:

  • bool: True if the control was removed, false if it was not present.

func (*NtSecurityDescriptorControl) Unmarshal

func (nsdc *NtSecurityDescriptorControl) Unmarshal(rawValue []byte) (int, error)

Unmarshal initializes the NtSecurityDescriptorControl struct by setting its RawValue and extracting the individual control flags from it. It populates the Values and Flags slices based on the control flags that are present in the RawValue.

Parameters:

  • rawValue (uint16): The raw value to be parsed, representing the control flags as a bitmask.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL