fix(agent/agentssh): allow scp to exit with zero status (#12028)

Fixes #11786
This commit is contained in:
Mathias Fredriksson
2024-02-07 10:22:31 +02:00
committed by GitHub
parent d3ccb07361
commit f2aef0726b
+1 -1
View File
@@ -557,7 +557,7 @@ func (s *Server) sftpHandler(logger slog.Logger, session ssh.Session) {
defer server.Close()
err = server.Serve()
if errors.Is(err, io.EOF) {
if err == nil || errors.Is(err, io.EOF) {
// Unless we call `session.Exit(0)` here, the client won't
// receive `exit-status` because `(*sftp.Server).Close()`
// calls `Close()` on the underlying connection (session),