Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Categories ¶
type Categories []uint16
func (Categories) Len ¶
func (c Categories) Len() int
func (Categories) Less ¶
func (c Categories) Less(i, j int) bool
func (Categories) Offset ¶
func (categories Categories) Offset() uint64
Offset returns the rank of the provided categories in the co-lex rank operation (k is implicit)
func (Categories) Swap ¶
func (c Categories) Swap(i, j int)
type Label ¶
type Label struct { Prefix string Categories }
func NewLabel ¶
NewLabel creates a Label object based on the offset given by offset with a number of labels equal to k. Prefix may be any valid SELinux label (user:role:type:level:).
func ParseLabel ¶
ParseLabel converts a string value representing an SELinux label into a Label object, extracting and ordering categories.
type Range ¶
type Range struct {
// contains filtered or unexported fields
}
func NewRange ¶
NewRange describes an SELinux category range, where prefix may include the user, type, role, and level of the range, and n and k represent the highest category c0 to c(N-1) and k represents the number of labels to use. A range can be used to check whether a given label matches the range.
func ParseRange ¶
ParseRange converts a string value representing an SELinux category range into a Range object, extracting the prefix -- which may include the user, type, and role of the range, the number of labels to use, and the maximum category to use. The input string is expected to be in the format:
<prefix>/<numLabels>[,<maxCategory>]
If the maximum category is not specified, it is defaulted to the maximum number of SELinux categories (1024).