1
0
mirror of https://github.com/rancher/os.git synced 2025-08-31 06:11:12 +00:00
Files
os/selinux/selinux_linux.go

17 lines
388 B
Go
Raw Normal View History

2016-02-19 16:11:32 -08:00
package selinux
// #cgo pkg-config: libselinux libsepol
// #include <selinux/selinux.h>
import "C"
func InitializeSelinux() (int, error) {
enforce := C.int(0)
ret, err := C.selinux_init_load_policy(&enforce)
return int(ret), err
}
func SetFileContext(path string, context string) (int, error) {
ret, err := C.setfilecon(C.CString(path), C.CString(context))
return int(ret), err
}