Files
OwnCord/Server/updater/proc_spawner_win.go
T
J3vb 9e399384c3 fix: suppress gosec false positives in Linux server support
- G204 in proc_spawner_nix.go and proc_spawner_win.go: exePath is the
  server's own validated binary path, not arbitrary user input
- G302 in updater.go: 0o755 is required for the extracted Linux binary
  to be executable
2026-04-03 08:45:45 +02:00

23 lines
507 B
Go

//go:build windows
package updater
import (
"os"
"os/exec"
"syscall"
)
// SpawnDetached starts a new process that is not attached to the current one.
func SpawnDetached(exePath string, args []string) error {
cmd := exec.Command(exePath, args...) //nolint:gosec // G204: exePath is the server's own binary path, validated by the caller
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.SysProcAttr = &syscall.SysProcAttr{
CreationFlags: 0x00000008, // DETACHED_PROCESS
}
return cmd.Start()
}