github.com/apptainer/singularity@v3.1.1+incompatible/internal/pkg/security/selinux/selinux_linux.go (about)

     1  // Copyright (c) 2018, Sylabs Inc. All rights reserved.
     2  // This software is licensed under a 3-clause BSD license. Please consult the
     3  // LICENSE.md file distributed with the sources of this project regarding your
     4  // rights to use or distribute this software.
     5  
     6  // +build selinux
     7  
     8  package selinux
     9  
    10  import (
    11  	goselinux "github.com/opencontainers/selinux/go-selinux"
    12  )
    13  
    14  // Enabled checks if SELinux is enabled or not
    15  func Enabled() bool {
    16  	return goselinux.GetEnabled()
    17  }
    18  
    19  // SetExecLabel sets the SELinux label for current process
    20  func SetExecLabel(label string) error {
    21  	return goselinux.SetExecLabel(label)
    22  }