mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-30 17:49:40 +09: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:
co-authored by
wxiaoguang
parent
88974d2db9
commit
eea03676d3
+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