mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 22:37:14 +08:00
5f4d3f3670
Unfortunately, Go documentation formatter does a sloppy job formatting documentation for variables -- it is rendered as comments (see [1]). Switch to using wrapper functions, solely for the sake of better documentation formatting. [1]: https://pkg.go.dev/github.com/opencontainers/runc@v1.3.0-rc.2/libcontainer/apparmor Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
19 lines
586 B
Go
19 lines
586 B
Go
package apparmor
|
|
|
|
import "errors"
|
|
|
|
// IsEnabled returns true if apparmor is enabled for the host.
|
|
func IsEnabled() bool {
|
|
return isEnabled()
|
|
}
|
|
|
|
// ApplyProfile will apply the profile with the specified name to the process
|
|
// after the next exec. It is only supported on Linux and produces an
|
|
// [ErrApparmorNotEnabled] on other platforms.
|
|
func ApplyProfile(name string) error {
|
|
return applyProfile(name)
|
|
}
|
|
|
|
// ErrApparmorNotEnabled indicates that AppArmor is not enabled or not supported.
|
|
var ErrApparmorNotEnabled = errors.New("apparmor: config provided but apparmor not supported")
|