Disable privileged tests for cve-2018-15664
authorArnaud Rebillout <arnaud.rebillout@collabora.com>
Wed, 4 Sep 2019 07:54:29 +0000 (08:54 +0100)
committerArnaud Rebillout <arnaud.rebillout@collabora.com>
Wed, 4 Sep 2019 07:54:29 +0000 (08:54 +0100)
Gbp-Pq: Name cve-2018-15664-03-debian-skip-privileged-tests.patch

engine/pkg/chrootarchive/archive_unix_test.go

index f39a88ad3814048c78963388d602d471f4f9c222..161be05f5e384439bc929013cdc8dfdc46ef06ff 100644 (file)
@@ -16,6 +16,7 @@ import (
        "github.com/docker/docker/pkg/archive"
        "golang.org/x/sys/unix"
        "gotest.tools/assert"
+       "gotest.tools/skip"
 )
 
 // Test for CVE-2018-15664
@@ -23,6 +24,7 @@ import (
 // some path outside of a container's rootfs that we do not copy data to a
 // container path that will actually overwrite data on the host
 func TestUntarWithMaliciousSymlinks(t *testing.T) {
+       skip.If(t, os.Getuid() != 0, "DM - skipping privileged test")
        dir, err := ioutil.TempDir("", t.Name())
        assert.NilError(t, err)
        defer os.RemoveAll(dir)
@@ -84,6 +86,7 @@ func TestUntarWithMaliciousSymlinks(t *testing.T) {
 // some path outside of a container's rootfs that we do not unwittingly leak
 // host data into the archive.
 func TestTarWithMaliciousSymlinks(t *testing.T) {
+       skip.If(t, os.Getuid() != 0, "DM - skipping privileged test")
        dir, err := ioutil.TempDir("", t.Name())
        assert.NilError(t, err)
        // defer os.RemoveAll(dir)