fix(auth): harden unified diagnostic execution

This commit is contained in:
2026-08-17 16:39:54 +02:00
parent 3ed00ff086
commit 30ee9433dc
20 changed files with 1034 additions and 57 deletions
@@ -0,0 +1,30 @@
//go:build windows
package compose
import (
"errors"
"os/exec"
"syscall"
"time"
)
const finalTerminationBound = 2 * time.Second
const createNewProcessGroup = 0x00000200
func configureProcess(command *exec.Cmd) {
command.SysProcAttr = &syscall.SysProcAttr{CreationFlags: createNewProcessGroup}
}
func terminateProcess(command *exec.Cmd, done <-chan error) error {
if command.Process == nil {
return nil
}
_ = command.Process.Kill()
select {
case <-done:
return nil
case <-time.After(finalTerminationBound):
return errors.New("Docker command could not be reaped")
}
}