Skip to content

Commit fc44aa8

Browse files
Merge pull request #3119 from jterry75/windows_lcow_vmgroup_access
Update Windows lcow differ to set NT VIRTUAL MACHINE\Virtual Machines SID
2 parents 24beaec + 7361b19 commit fc44aa8

22 files changed

Lines changed: 758 additions & 446 deletions

diff/lcow/lcow.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"path"
2626
"time"
2727

28+
"github.com/Microsoft/go-winio/pkg/security"
2829
"github.com/Microsoft/hcsshim/ext4/tar2ext4"
2930
"github.com/containerd/containerd/archive/compression"
3031
"github.com/containerd/containerd/content"
@@ -142,7 +143,6 @@ func (s windowsLcowDiff) Apply(ctx context.Context, desc ocispec.Descriptor, mou
142143
if err != nil {
143144
return emptyDesc, err
144145
}
145-
defer outFile.Close()
146146
defer func() {
147147
if err != nil {
148148
outFile.Close()
@@ -154,6 +154,12 @@ func (s windowsLcowDiff) Apply(ctx context.Context, desc ocispec.Descriptor, mou
154154
if err != nil {
155155
return emptyDesc, errors.Wrapf(err, "failed to convert tar to ext4 vhd")
156156
}
157+
outFile.Close()
158+
159+
err = security.GrantVmGroupAccess(layerPath)
160+
if err != nil {
161+
return emptyDesc, errors.Wrapf(err, "failed GrantVmGroupAccess on layer vhd: %v", layerPath)
162+
}
157163

158164
return ocispec.Descriptor{
159165
MediaType: ocispec.MediaTypeImageLayer,

vendor.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ github.com/opencontainers/image-spec v1.0.1
3333
golang.org/x/sync 42b317875d0fa942474b76e1b46a6060d720ae6e
3434
github.com/BurntSushi/toml a368813c5e648fee92e5f6c30e3944ff9d5e8895
3535
github.com/grpc-ecosystem/go-grpc-prometheus 6b7015e65d366bf3f19b2b2a000a831940f0f7e0
36-
github.com/Microsoft/go-winio v0.4.12
36+
github.com/Microsoft/go-winio c599b533b43b1363d7d7c6cfda5ede70ed73ff13
3737
github.com/Microsoft/hcsshim v0.8.5
3838
google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944
3939
golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4

vendor/github.com/Microsoft/go-winio/internal/etw/eventdata.go

Lines changed: 0 additions & 65 deletions
This file was deleted.

vendor/github.com/Microsoft/go-winio/internal/etw/eventmetadata.go

Lines changed: 0 additions & 177 deletions
This file was deleted.

vendor/github.com/Microsoft/go-winio/internal/etw/etw.go renamed to vendor/github.com/Microsoft/go-winio/pkg/etw/etw.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/Microsoft/go-winio/pkg/etw/eventdata.go

Lines changed: 65 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/Microsoft/go-winio/internal/etw/eventdatadescriptor.go renamed to vendor/github.com/Microsoft/go-winio/pkg/etw/eventdatadescriptor.go

File renamed without changes.

0 commit comments

Comments
 (0)