archive: do not call FollowSymlinkInScope in createTarFile

Signed-off-by: Tibor Vass <teabee89@gmail.com>
This commit is contained in:
Tibor Vass 2014-11-19 11:27:34 -05:00 committed by unclejack
parent 78bd3c0356
commit bdff6d8011
3 changed files with 23 additions and 10 deletions

View file

@ -587,6 +587,20 @@ func TestUntarInvalidSymlink(t *testing.T) {
Mode: 0644,
},
},
{ // try writing to victim/newdir/newfile with a symlink in the path
{
// this header needs to be before the next one, or else there is an error
Name: "dir/loophole",
Typeflag: tar.TypeSymlink,
Linkname: "../../victim",
Mode: 0755,
},
{
Name: "dir/loophole/newdir/newfile",
Typeflag: tar.TypeReg,
Mode: 0644,
},
},
} {
if err := testBreakout("untar", "docker-TestUntarInvalidSymlink", headers); err != nil {
t.Fatalf("i=%d. %v", i, err)