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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

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),