Initial work on selinux patch

This has every container using the docker daemon's pid for the processes
label so it does not work correctly.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
Michael Crosby 2014-04-17 23:47:27 +00:00
parent f6024af3e8
commit 48d893cc6b
2 changed files with 6 additions and 5 deletions

View file

@ -32,13 +32,13 @@ func GenLabels(options string) (string, string, error) {
return processLabel, mountLabel, err
}
func FormatMountLabel(src string, mountLabel string) string {
if selinux.SelinuxEnabled() && mountLabel != "" {
func FormatMountLabel(src, mountLabel string) string {
if mountLabel != "" {
switch src {
case "":
src = fmt.Sprintf("%s,context=%s", src, mountLabel)
src = fmt.Sprintf("context=%q", mountLabel)
default:
src = fmt.Sprintf("context=%s", mountLabel)
src = fmt.Sprintf("%s,context=%q", src, mountLabel)
}
}
return src