Skip to content

Commit f15b99e

Browse files
committed
wip: testing
1 parent bb90f45 commit f15b99e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

cache/contenthash/checksum.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ type ChecksumOpts struct {
6262
}
6363

6464
func Checksum(ctx context.Context, ref cache.ImmutableRef, path string, opts ChecksumOpts, s session.Group) (digest.Digest, error) {
65-
// only applies for Windows, it's a no-op on non-Windows.
66-
enableProcessPrivileges()
67-
defer disableProcessPrivileges()
6865
return getDefaultManager().Checksum(ctx, ref, path, opts, s)
6966
}
7067

@@ -866,6 +863,10 @@ func (cc *cacheContext) scanChecksum(ctx context.Context, m *mount, p string, fo
866863
}
867864

868865
func (cc *cacheContext) checksum(ctx context.Context, root *iradix.Node[*CacheRecord], txn *iradix.Txn[*CacheRecord], m *mount, k []byte, followTrailing bool) (*CacheRecord, bool, error) {
866+
// only applies for Windows, it's a no-op on non-Windows.
867+
enableProcessPrivileges()
868+
defer disableProcessPrivileges()
869+
869870
origk := k
870871
k, cr, err := getFollowLinks(root, k, followTrailing)
871872
if err != nil {

cache/contenthash/checksum_windows.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package contenthash
22

33
import (
4+
"context"
45
"path/filepath"
56

67
"github.com/Microsoft/go-winio"
8+
"github.com/moby/buildkit/util/bklog"
79
)
810

911
var privileges = []string{winio.SeBackupPrivilege}
@@ -26,4 +28,5 @@ func enableProcessPrivileges() {
2628
// once the group of functions that needed it is complete.
2729
func disableProcessPrivileges() {
2830
_ = winio.DisableProcessPrivileges(privileges)
31+
bklog.G(context.TODO()).Info("==> privilege disabled!!")
2932
}

0 commit comments

Comments
 (0)