mirror of
https://github.com/rancher/os.git
synced 2025-09-16 06:59:12 +00:00
Move around code for better clarity
This commit is contained in:
committed by
niusmallnan
parent
2f50b7b178
commit
1f50386828
16
pkg/selinux/selinux_linux.go
Normal file
16
pkg/selinux/selinux_linux.go
Normal file
@@ -0,0 +1,16 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user