Skip to content

Commit

Permalink
Don't hard code SELinux labels into code
Browse files Browse the repository at this point in the history
These labels can be changed based on installed policy.

I am working on allowing containers within containers, but this
will require different SELinux label types other then container_file_t.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
  • Loading branch information
rhatdan committed Feb 22, 2023
1 parent 0697414 commit 01b671b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/overlay/overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ var (
)

const (
defaultPerms = os.FileMode(0555)
selinuxLabelTest = "system_u:object_r:container_file_t:s0"
defaultPerms = os.FileMode(0555)
)

// This backend uses the overlay union filesystem for containers
Expand Down Expand Up @@ -657,6 +656,8 @@ func SupportsNativeOverlay(home, runhome string) (bool, error) {
func supportsOverlay(home string, homeMagic graphdriver.FsMagic, rootUID, rootGID int) (supportsDType bool, err error) {
// We can try to modprobe overlay first

selinuxLabelTest := selinux.PrivContainerMountLabel()

exec.Command("modprobe", "overlay").Run()

logLevel := logrus.ErrorLevel
Expand Down

0 comments on commit 01b671b

Please sign in to comment.