[client] Use setsid to avoid the parent process from being killed via HUP by login (#4900)

This commit is contained in:
Viktor Liu
2025-12-05 03:29:27 +01:00
committed by GitHub
parent cb6b086164
commit f538e6e9ae
5 changed files with 71 additions and 8 deletions

View File

@@ -383,6 +383,11 @@ func (s *Server) detectSuPtySupport(context.Context) bool {
return false
}
// detectUtilLinuxLogin always returns false on Windows
func (s *Server) detectUtilLinuxLogin(context.Context) bool {
return false
}
// executeCommandWithPty executes a command with PTY allocation on Windows using ConPty
func (s *Server) executeCommandWithPty(logger *log.Entry, session ssh.Session, execCmd *exec.Cmd, privilegeResult PrivilegeCheckResult, ptyReq ssh.Pty, winCh <-chan ssh.Window) bool {
command := session.RawCommand()