runc-0.0.4
authorPaul Tagliamonte <paultag@debian.org>
Wed, 4 Nov 2015 08:09:02 +0000 (08:09 +0000)
committerTianon Gravi <tianon@debian.org>
Wed, 4 Nov 2015 08:09:02 +0000 (08:09 +0000)
Gbp-Pq: Name runc-0.0.4.patch

daemon/container.go
daemon/create.go
daemon/volumes.go

index 49c1f41e3ef09a7bca88e478c12899e459b9784b..727bd69002c426d5d6dface05fe18ace28ee7826 100644 (file)
@@ -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",
index a4a740f0e13c7f46635de5b10328afcbba20d6d4..655bd8fbf5a381629ee75791626166bfe3c2adfe 100644 (file)
@@ -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
                }
 
index 556e304977167bdbd4e21dda7e40b2b70436ef71..ba2b01796d36d872a5e97aadb269955592a342bf 100644 (file)
@@ -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