Skip to content

Commit

Permalink
Fix killProcessGroup (#1489)
Browse files Browse the repository at this point in the history
  • Loading branch information
directionless authored Nov 30, 2023
1 parent 21ab35d commit bd3911b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/osquery/runtime/runtime_helpers_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ func setpgid() *syscall.SysProcAttr {
return &syscall.SysProcAttr{}
}

func killProcessGroup(cmd *exec.Cmd) error {
func killProcessGroup(origCmd *exec.Cmd) error {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

// some discussion here https://github.com/golang/dep/pull/857
cmd, err := allowedcmd.Taskkill(ctx, "/F", "/T", "/PID", fmt.Sprint(cmd.Process.Pid))
cmd, err := allowedcmd.Taskkill(ctx, "/F", "/T", "/PID", fmt.Sprint(origCmd.Process.Pid))
if err != nil {
return fmt.Errorf("creating command: %w", err)
}
Expand Down

0 comments on commit bd3911b

Please sign in to comment.