From: Paul Tagliamonte Date: Wed, 4 Nov 2015 08:09:02 +0000 (+0000) Subject: runc-0.0.4 X-Git-Tag: archive/raspbian/18.09.1+dfsg1-7+rpi1~1^2^2^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6de5a3df206101969bd1d6545af5d8d5ff84416e;p=docker.io.git runc-0.0.4 Gbp-Pq: Name runc-0.0.4.patch --- diff --git a/daemon/container.go b/daemon/container.go index 49c1f41e..727bd690 100644 --- a/daemon/container.go +++ b/daemon/container.go @@ -1088,12 +1088,9 @@ func copyEscapable(dst io.Writer, src io.ReadCloser) (written int64, err error) func (container *Container) networkMounts() []execdriver.Mount { var mounts []execdriver.Mount - mode := "Z" - if container.hostConfig.NetworkMode.IsContainer() { - mode = "z" - } + shared := container.hostConfig.NetworkMode.IsContainer() if container.ResolvConfPath != "" { - label.Relabel(container.ResolvConfPath, container.MountLabel, mode) + label.Relabel(container.ResolvConfPath, container.MountLabel, shared) mounts = append(mounts, execdriver.Mount{ Source: container.ResolvConfPath, Destination: "/etc/resolv.conf", @@ -1102,7 +1099,7 @@ func (container *Container) networkMounts() []execdriver.Mount { }) } if container.HostnamePath != "" { - label.Relabel(container.HostnamePath, container.MountLabel, mode) + label.Relabel(container.HostnamePath, container.MountLabel, shared) mounts = append(mounts, execdriver.Mount{ Source: container.HostnamePath, Destination: "/etc/hostname", @@ -1111,7 +1108,7 @@ func (container *Container) networkMounts() []execdriver.Mount { }) } if container.HostsPath != "" { - label.Relabel(container.HostsPath, container.MountLabel, mode) + label.Relabel(container.HostsPath, container.MountLabel, shared) mounts = append(mounts, execdriver.Mount{ Source: container.HostsPath, Destination: "/etc/hosts", diff --git a/daemon/create.go b/daemon/create.go index a4a740f0..655bd8fb 100644 --- a/daemon/create.go +++ b/daemon/create.go @@ -123,7 +123,7 @@ func (daemon *Daemon) Create(config *runconfig.Config, hostConfig *runconfig.Hos if err != nil { return nil, nil, err } - if err := label.Relabel(v.Path(), container.MountLabel, "z"); err != nil { + if err := label.Relabel(v.Path(), container.MountLabel, true); err != nil { return nil, nil, err } diff --git a/daemon/volumes.go b/daemon/volumes.go index 556e3049..ba2b0179 100644 --- a/daemon/volumes.go +++ b/daemon/volumes.go @@ -231,7 +231,8 @@ func (daemon *Daemon) registerMountPoints(container *Container, hostConfig *runc } } - if err := label.Relabel(bind.Source, container.MountLabel, bind.Relabel); err != nil { + shared := label.IsShared(bind.Relabel) + if err := label.Relabel(bind.Source, container.MountLabel, shared); err != nil { return err } binds[bind.Destination] = true