selinux

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 19 Imported by: 553

Documentation

Overview

Package selinux provides a high-level interface for interacting with selinux.

Usage:

import "github.com/opencontainers/selinux/go-selinux"

// Ensure that selinux is enforcing mode.
if selinux.EnforceMode() != selinux.Enforcing {
	selinux.SetEnforceMode(selinux.Enforcing)
}

Index

Constants

View Source
const (
	// Enforcing constant indicate SELinux is in enforcing mode
	Enforcing = 1
	// Permissive constant to indicate SELinux is in permissive mode
	Permissive = 0
	// Disabled constant to indicate SELinux is disabled
	Disabled = -1

	// DefaultCategoryRange is the upper bound on the category range
	DefaultCategoryRange = uint32(maxCategory)
)

Variables

View Source
var (
	// ErrMCSAlreadyExists is returned when trying to allocate a duplicate MCS.
	ErrMCSAlreadyExists = errors.New("MCS label already exists")
	// ErrEmptyPath is returned when an empty path has been specified.
	ErrEmptyPath = errors.New("empty path")

	// ErrInvalidLabel is returned when an invalid label is specified.
	ErrInvalidLabel = errors.