aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cli/internal/tarpatch/tar_windows.go
blob: 486e6fdc748d126deb8959932db7daf76dca50a8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
}