diff --git a/.gitignore b/.gitignore index 8c32a3a6ec..b7bde7caf3 100644 --- a/.gitignore +++ b/.gitignore @@ -32,9 +32,12 @@ bin/* rootfs/* rootfs-conv/* *.o -/build/ +build +protobuf + deps/* out/* +tmp # test results test/results @@ -46,3 +49,7 @@ build.ninja # go workspaces go.work go.work.sum + +# ninja build +.ninja_log +build.ninja diff --git a/internal/guest/runtime/hcsv2/process.go b/internal/guest/runtime/hcsv2/process.go index 5731932e70..f39a177ae5 100644 --- a/internal/guest/runtime/hcsv2/process.go +++ b/internal/guest/runtime/hcsv2/process.go @@ -264,7 +264,7 @@ type externalProcess struct { remove func(pid int) } -var _ Process = &containerProcess{} +var _ Process = &externalProcess{} func (ep *externalProcess) Kill(ctx context.Context, signal syscall.Signal) error { if err := syscall.Kill(int(ep.cmd.Process.Pid), signal); err != nil { diff --git a/internal/tools/uvmboot/lcow.go b/internal/tools/uvmboot/lcow.go index 6bb7679c08..7ebe84e2d7 100644 --- a/internal/tools/uvmboot/lcow.go +++ b/internal/tools/uvmboot/lcow.go @@ -109,7 +109,7 @@ var lcowCommand = cli.Command{ cli.StringSliceFlag{ Name: scsiMountsArgName, Usage: "List of VHDs to SCSI mount into the UVM. Use repeat instances to add multiple. " + - "Value is of the form `host,guest[,w]`, where `host` is path to the VHD, " + + "Value is of the form `host[,guest[,w]]`, where `host` is path to the VHD, " + "`guest` is the mount path inside the UVM, and `w` optionally mounts as writeable", }, cli.StringSliceFlag{ @@ -221,6 +221,7 @@ func createLCOWOptions(_ context.Context, c *cli.Context, id string) (*uvm.Optio if c.IsSet(securityPolicyArgName) { options.SecurityPolicy = c.String(options.SecurityPolicy) + options.SecurityPolicyEnabled = true } return options, nil diff --git a/internal/tools/uvmboot/mounts.go b/internal/tools/uvmboot/mounts.go index ca1c277fa4..8e7145114d 100644 --- a/internal/tools/uvmboot/mounts.go +++ b/internal/tools/uvmboot/mounts.go @@ -48,6 +48,10 @@ func shareFiles(ctx context.Context, c *cli.Context, vm *uvm.UtilityVM) error { func shareFilesLCOW(ctx context.Context, c *cli.Context, vm *uvm.UtilityVM) error { for _, s := range parseMounts(c, shareFilesArgName) { + if s.guest == "" { + return fmt.Errorf("file shares %q has invalid quest destination: %q", s.host, s.guest) + } + if err := vm.Share(ctx, s.host, s.guest, !s.writable); err != nil { return fmt.Errorf("could not share file or directory %s: %w", s.host, err) } else { @@ -90,12 +94,15 @@ func parseMounts(c *cli.Context, n string) []mount { func mountFromString(s string) (m mount, _ error) { ps := strings.Split(s, ",") - if len(ps) != 2 && len(ps) != 3 { + if len(ps) >= 3 { return m, errors.New("too many parts") } m.host = ps[0] - m.guest = ps[1] + + if len(ps) == 2 { + m.guest = ps[1] + } if len(ps) == 3 && strings.ToLower(ps[2]) == "w" { m.writable = true diff --git a/test/vendor/github.com/Microsoft/hcsshim/.gitignore b/test/vendor/github.com/Microsoft/hcsshim/.gitignore index 8c32a3a6ec..b7bde7caf3 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/.gitignore +++ b/test/vendor/github.com/Microsoft/hcsshim/.gitignore @@ -32,9 +32,12 @@ bin/* rootfs/* rootfs-conv/* *.o -/build/ +build +protobuf + deps/* out/* +tmp # test results test/results @@ -46,3 +49,7 @@ build.ninja # go workspaces go.work go.work.sum + +# ninja build +.ninja_log +build.ninja