From 10125aea134c6a793da1a3957f854bbeb474e2ff Mon Sep 17 00:00:00 2001 From: fangdingjun Date: Tue, 14 Aug 2018 17:43:40 +0800 Subject: [PATCH] send exit-status to client after sftp done --- server.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server.go b/server.go index 178c041..fdc0511 100644 --- a/server.go +++ b/server.go @@ -114,13 +114,16 @@ func serveSFTP(ch ssh.Channel) { if err != nil { log.Debugf("start sftp server failed: %s", err) + ch.SendRequest("exit-status", false, ssh.Marshal(exitStatus{Status: 127})) return } if err := server.Serve(); err != nil { log.Debugf("sftp server finished with error: %s", err) + ch.SendRequest("exit-status", false, ssh.Marshal(exitStatus{Status: 127})) return } + ch.SendRequest("exit-status", false, ssh.Marshal(exitStatus{Status: 0})) } type directTcpipMsg struct {