1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 06:40:31 +00:00
Files
os/pkg/init/selinux/selinux.go
Olli Janatuinen 4148642e5f v2.0.0-beta6
- Buildroot 2022.02.8
-- with cherry-picked memory leak fix for dhcpcd
- Kernel 5.10.162
- Docker 23.0.0-rc.3
- System-docker 17.06.107
- Removed debugging tool system-docker-containerd-ctr
- Build ros binary with Go version 1.19.5
- Improve debug mode by disabling auto reboot and asking resolution
2023-01-22 14:16:32 +01:00

35 lines
708 B
Go

//go:build linux
// +build linux
package selinux
import (
"io/ioutil"
"github.com/burmilla/os/config"
"github.com/burmilla/os/pkg/log"
"github.com/burmilla/os/pkg/selinux"
)
func Initialize(c *config.CloudConfig) (*config.CloudConfig, error) {
ret, _ := selinux.InitializeSelinux()
if ret != 0 {
log.Debug("Unable to initialize SELinux")
return c, nil
}
// Set allow_execstack boolean to true
if err := ioutil.WriteFile("/sys/fs/selinux/booleans/allow_execstack", []byte("1"), 0644); err != nil {
log.Debug(err)
return c, nil
}
if err := ioutil.WriteFile("/sys/fs/selinux/commit_pending_bools", []byte("1"), 0644); err != nil {
log.Debug(err)
return c, nil
}
return c, nil
}