vendor: update buildkit to 8397d0b9

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2024-06-27 20:24:41 -07:00
parent 04000db8da
commit af902caeaa
7 changed files with 45 additions and 9 deletions

View File

@ -21,10 +21,6 @@ type Stream interface {
RecvMsg(m interface{}) error
}
func sendDiffCopy(stream Stream, fs fsutil.FS, progress progressCb) error {
return errors.WithStack(fsutil.Send(stream.Context(), stream, fs, progress))
}
func newStreamWriter(stream grpc.ClientStream) io.WriteCloser {
wc := &streamWriterCloser{ClientStream: stream}
return &bufferedWriteCloser{Writer: bufio.NewWriter(wc), Closer: wc}

View File

@ -0,0 +1,13 @@
//go:build !windows
// +build !windows
package filesync
import (
"github.com/pkg/errors"
"github.com/tonistiigi/fsutil"
)
func sendDiffCopy(stream Stream, fs fsutil.FS, progress progressCb) error {
return errors.WithStack(fsutil.Send(stream.Context(), stream, fs, progress))
}

View File

@ -0,0 +1,21 @@
//go:build windows
// +build windows
package filesync
import (
"github.com/Microsoft/go-winio"
"github.com/pkg/errors"
"github.com/tonistiigi/fsutil"
)
func sendDiffCopy(stream Stream, fs fsutil.FS, progress progressCb) error {
// adding one SeBackupPrivilege to the process so as to be able
// to run the subsequent goroutines in fsutil.Send that need
// to copy over special Windows metadata files.
// TODO(profnandaa): need to cross-check that this cannot be
// exploited in any way.
winio.EnableProcessPrivileges([]string{winio.SeBackupPrivilege})
defer winio.DisableProcessPrivileges([]string{winio.SeBackupPrivilege})
return errors.WithStack(fsutil.Send(stream.Context(), stream, fs, progress))
}