aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/opencontainers/runc/libcontainer/apparmor
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-06-25 10:02:34 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-06-29 15:58:32 -0400
commit05f39af5bd716ce8d02a41e5c0aa1a2d632dab07 (patch)
treee9d2d0c43f3aa65dae28d71950b2824bd091b2be /vendor/github.com/opencontainers/runc/libcontainer/apparmor
parent793063e086d2a7fe15833be5456af95bc9b6ba24 (diff)
downloadpodman-05f39af5bd716ce8d02a41e5c0aa1a2d632dab07.tar.gz
podman-05f39af5bd716ce8d02a41e5c0aa1a2d632dab07.tar.bz2
podman-05f39af5bd716ce8d02a41e5c0aa1a2d632dab07.zip
Bump github.com/containers/storage from 1.32.3 to 1.32.5
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.32.3 to 1.32.5. - [Release notes](https://github.com/containers/storage/releases) - [Changelog](https://github.com/containers/storage/blob/main/docs/containers-storage-changes.md) - [Commits](https://github.com/containers/storage/compare/v1.32.3...v1.32.5) --- updated-dependencies: - dependency-name: github.com/containers/storage dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/github.com/opencontainers/runc/libcontainer/apparmor')
-rw-r--r--vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor.go16
-rw-r--r--vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_linux.go11
-rw-r--r--vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_unsupported.go10
3 files changed, 24 insertions, 13 deletions
diff --git a/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor.go b/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor.go
new file mode 100644
index 000000000..4b03d4c71
--- /dev/null
+++ b/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor.go
@@ -0,0 +1,16 @@
+package apparmor
+
+import "errors"
+
+var (
+ // IsEnabled returns true if apparmor is enabled for the host.
+ IsEnabled = 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.
+ ApplyProfile = applyProfile
+
+ // ErrApparmorNotEnabled indicates that AppArmor is not enabled or not supported.
+ ErrApparmorNotEnabled = errors.New("apparmor: config provided but apparmor not supported")
+)
diff --git a/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_linux.go b/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_linux.go
index 5da14fb3b..744d4e570 100644
--- a/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_linux.go
+++ b/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_linux.go
@@ -15,8 +15,8 @@ var (
checkAppArmor sync.Once
)
-// IsEnabled returns true if apparmor is enabled for the host.
-func IsEnabled() bool {
+// isEnabled returns true if apparmor is enabled for the host.
+func isEnabled() bool {
checkAppArmor.Do(func() {
if _, err := os.Stat("/sys/kernel/security/apparmor"); err == nil {
buf, err := ioutil.ReadFile("/sys/module/apparmor/parameters/enabled")
@@ -57,9 +57,10 @@ func changeOnExec(name string) error {
return nil
}
-// ApplyProfile will apply the profile with the specified name to the process after
-// the next exec.
-func ApplyProfile(name string) error {
+// 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 error on other
+// platforms.
+func applyProfile(name string) error {
if name == "" {
return nil
}
diff --git a/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_unsupported.go b/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_unsupported.go
index 0bc473f81..1adadafec 100644
--- a/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_unsupported.go
+++ b/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_unsupported.go
@@ -2,17 +2,11 @@
package apparmor
-import (
- "errors"
-)
-
-var ErrApparmorNotEnabled = errors.New("apparmor: config provided but apparmor not supported")
-
-func IsEnabled() bool {
+func isEnabled() bool {
return false
}
-func ApplyProfile(name string) error {
+func applyProfile(name string) error {
if name != "" {
return ErrApparmorNotEnabled
}