mcs

package
v1.4.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2016 License: Apache-2.0 Imports: 5 Imported by: 320

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

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.

func (*Label) String

func (labels *Label) String() string

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).

func (*Range) Contains

func (r *Range) Contains(label *Label) bool

func (*Range) LabelAt

func (r *Range) LabelAt(offset uint64) (*Label, bool)

func (*Range) Offset

func (r *Range) Offset(label *Label) (bool, uint64)

func (*Range) Size

func (r *Range) Size() uint64

func (*Range) String

func (r *Range) String() string

Jump to

Keyboard shortcuts

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