diff options
| author | 2023-04-28 01:36:44 +0800 | |
|---|---|---|
| committer | 2023-04-28 01:36:44 +0800 | |
| commit | dd84b9d64fb98746a230cd24233ff50a562c39c9 (patch) | |
| tree | b583261ef00b3afe72ec4d6dacb31e57779a6faf /cli/internal/tarpatch/tar_windows.go | |
| parent | 0b46fcd72ac34382387b2bcf9095233efbcc52f4 (diff) | |
| download | HydroRoll-dd84b9d64fb98746a230cd24233ff50a562c39c9.tar.gz HydroRoll-dd84b9d64fb98746a230cd24233ff50a562c39c9.zip | |
Diffstat (limited to 'cli/internal/tarpatch/tar_windows.go')
| -rw-r--r-- | cli/internal/tarpatch/tar_windows.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/cli/internal/tarpatch/tar_windows.go b/cli/internal/tarpatch/tar_windows.go new file mode 100644 index 0000000..486e6fd --- /dev/null +++ b/cli/internal/tarpatch/tar_windows.go @@ -0,0 +1,27 @@ +//go:build windows +// +build windows + +// Adapted from https://github.com/moby/moby/blob/924edb948c2731df3b77697a8fcc85da3f6eef57/pkg/archive/archive_windows.go +// Copyright Docker, Inc. +// SPDX-License-Identifier: Apache-2.0 + +package tarpatch + +import ( + "archive/tar" + "os" +) + +// chmodTarEntry is used to adjust the file permissions used in tar header based +// on the platform the archival is done. +func chmodTarEntry(perm os.FileMode) os.FileMode { + // Remove group- and world-writable bits. + perm &= 0o755 + + // Add the x bit: make everything +x on Windows + return perm | 0o111 +} + +func sysStat(fi os.FileInfo, hdr *tar.Header) error { + return nil +} |
