Merge pull request #7660 from rhatdan/selinux-volumes
Change default label of container volumes to shared SELinux Label
This commit is contained in:
commit
971240696f
1 changed files with 7 additions and 1 deletions
|
@ -3,10 +3,12 @@ package vfs
|
|||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/docker/docker/daemon/graphdriver"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
|
||||
"github.com/docker/docker/daemon/graphdriver"
|
||||
"github.com/docker/libcontainer/label"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -67,6 +69,10 @@ func (d *Driver) Create(id, parent string) error {
|
|||
if err := os.Mkdir(dir, 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
opts := []string{"level:s0"}
|
||||
if _, mountLabel, err := label.InitLabels(opts); err == nil {
|
||||
label.Relabel(dir, mountLabel, "")
|
||||
}
|
||||
if parent == "" {
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue