2020-12-22 04:21:39 +08:00
|
|
|
// +build linux
|
2018-09-05 22:44:28 +08:00
|
|
|
|
|
|
|
package buildah
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/opencontainers/runtime-tools/generate"
|
2019-04-24 03:09:01 +08:00
|
|
|
selinux "github.com/opencontainers/selinux/go-selinux"
|
2018-09-05 22:44:28 +08:00
|
|
|
)
|
|
|
|
|
2019-07-25 22:10:03 +08:00
|
|
|
func selinuxGetEnabled() bool {
|
|
|
|
return selinux.GetEnabled()
|
|
|
|
}
|
|
|
|
|
2018-09-05 22:44:28 +08:00
|
|
|
func setupSelinux(g *generate.Generator, processLabel, mountLabel string) {
|
2019-04-24 03:09:01 +08:00
|
|
|
if processLabel != "" && selinux.GetEnabled() {
|
|
|
|
g.SetProcessSelinuxLabel(processLabel)
|
|
|
|
g.SetLinuxMountLabel(mountLabel)
|
|
|
|
}
|
2018-09-05 22:44:28 +08:00
|
|
|
}
|