Fixing Tar functions to support Windows long paths.
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com> Upstream-commit: 230cfc6ed21e9398b9b3df765e6c02e90031d728 Component: engine
This commit is contained in:
committed by
John Howard
parent
93f026e522
commit
221348d130
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user