add selinux category range to config

This allows an admin to set the upper bounds on the category range for selinux
labels.  This can be useful when handling allocation of PVs or other volume
types that need to be shared with selinux enabled on the hosts and volumes.

Signed-off-by: Michael Crosby <michael@thepasture.io>
This commit is contained in:
Michael Crosby
2020-07-20 07:43:21 -04:00
parent 9b06da4773
commit 5f5d954b6a
5 changed files with 18 additions and 7 deletions

View File

@@ -44,6 +44,9 @@ func (c *criService) initPlatform() error {
if !selinux.GetEnabled() {
logrus.Warn("Selinux is not supported")
}
if r := c.config.SelinuxCategoryRange; r > 0 {
selinux.CategoryRange = uint32(r)
}
} else {
selinux.SetDisabled()
}