Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Categories ¶
type Categories []uint16
type Label ¶
type Label struct {
Prefix string
Categories
}
func NewLabel ¶
func NewLabel(prefix string, offset uint64, k uint) (*Label, error)
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 ¶
func ParseLabel(in string) (*Label, error)
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 ¶
func NewRange(prefix string, n, k uint) (*Range, error)
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 ¶
func ParseRange(in string) (*Range, error)
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).