mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-01 00:00:43 +00:00
fix(process): reap entire process group on cmd.Cancel (#39143)
Signed-off-by: Royce Remer <royceremer@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
+1
-3
@@ -75,7 +75,7 @@ func sessionHandler(session *sshSession) int {
|
||||
}
|
||||
}
|
||||
|
||||
cmd := exec.CommandContext(ctx, setting.AppPath, args...)
|
||||
cmd := process.CommandContext(ctx, setting.AppPath, args...)
|
||||
cmd.Env = append(
|
||||
os.Environ(),
|
||||
"SSH_ORIGINAL_COMMAND="+session.rawCmd,
|
||||
@@ -104,8 +104,6 @@ func sessionHandler(session *sshSession) int {
|
||||
}
|
||||
defer stdin.Close()
|
||||
|
||||
process.SetSysProcAttribute(cmd)
|
||||
|
||||
wg := &sync.WaitGroup{}
|
||||
|
||||
if err = cmd.Start(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user