Fixing Tar functions to support Windows long paths.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
This commit is contained in:
Stefan J. Wernli 2015-08-10 15:21:30 -07:00 committed by John Howard
parent 732af35366
commit 1c1d0c5f6f
4 changed files with 43 additions and 3 deletions

View file

@ -5,6 +5,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/docker/docker/pkg/archive"
)
@ -14,6 +15,12 @@ import (
// contents of the layer.
func applyLayerHandler(dest string, layer archive.Reader, decompress bool) (size int64, err error) {
dest = filepath.Clean(dest)
// Ensure it is a Windows-style volume path
if !strings.HasPrefix(dest, `\\?\`) {
dest = `\\?\` + dest
}
if decompress {
decompressed, err := archive.DecompressStream(layer)
if err != nil {