Fix exported comments enforcer in CI

Add comments where missing and fix incorrect comments

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2021-03-08 15:36:42 -08:00
parent 031775ee5e
commit 35eeb24a17
26 changed files with 65 additions and 14 deletions

View File

@@ -22,6 +22,7 @@ import (
"github.com/opencontainers/selinux/go-selinux"
)
// Store is used to store SELinux process labels
type Store struct {
sync.Mutex
levels map[string]int
@@ -29,6 +30,7 @@ type Store struct {
Reserver func(string)
}
// NewStore creates a new SELinux process label store
func NewStore() *Store {
return &Store{
levels: map[string]int{},
@@ -37,6 +39,8 @@ func NewStore() *Store {
}
}
// Reserve reserves the MLS/MCS level component of the specified label
// and prevents multiple reserves for the same level
func (s *Store) Reserve(label string) error {
s.Lock()
defer s.Unlock()
@@ -60,6 +64,9 @@ func (s *Store) Reserve(label string) error {
return nil
}
// Release un-reserves the MLS/MCS level component of the specified label,
// allowing it to be used by another process once labels with the same
// level have been released.
func (s *Store) Release(label string) {
s.Lock()
defer s.Unlock()