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 {