From 19c31a703fb84f1079cc2466d435cb4913a4bfd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 11 Jun 2015 00:34:18 +0200 Subject: [PATCH] zfs: correctly apply selinux context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #13858 Signed-off-by: Jörg Thalheim --- daemon/graphdriver/zfs/zfs.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/daemon/graphdriver/zfs/zfs.go b/daemon/graphdriver/zfs/zfs.go index 540ddca822..d08645291d 100644 --- a/daemon/graphdriver/zfs/zfs.go +++ b/daemon/graphdriver/zfs/zfs.go @@ -17,6 +17,7 @@ import ( "github.com/docker/docker/daemon/graphdriver" "github.com/docker/docker/pkg/mount" "github.com/docker/docker/pkg/parsers" + "github.com/docker/libcontainer/label" zfs "github.com/mistifyio/go-zfs" ) @@ -268,14 +269,15 @@ func (d *Driver) Remove(id string) error { func (d *Driver) Get(id, mountLabel string) (string, error) { mountpoint := d.MountPath(id) filesystem := d.ZfsPath(id) - log.Debugf(`[zfs] mount("%s", "%s", "%s")`, filesystem, mountpoint, mountLabel) + options := label.FormatMountLabel("", mountLabel) + log.Debugf(`[zfs] mount("%s", "%s", "%s")`, filesystem, mountpoint, options) // Create the target directories if they don't exist if err := os.MkdirAll(mountpoint, 0755); err != nil && !os.IsExist(err) { return "", err } - err := mount.Mount(filesystem, mountpoint, "zfs", mountLabel) + err := mount.Mount(filesystem, mountpoint, "zfs", options) if err != nil { return "", fmt.Errorf("error creating zfs mount of %s to %s: %v", filesystem, mountpoint, err) }