Unverified Commit e758f922 authored by Eric_Lee's avatar Eric_Lee Committed by GitHub

Merge pull request #146 from jumpserver/dev_bugfix

[bugfix] fix bugs
parents b4ed7c7a 952f26c1
......@@ -34,7 +34,7 @@ func SftpHandler(sess ssh.Session) {
logger.Infof("SFTP request %s: Handler start", reqID)
req := sftp.NewRequestServer(sess, handlers)
if err := req.Serve(); err == io.EOF {
logger.Debug("SFTP request %s: Exited session.", reqID)
logger.Debugf("SFTP request %s: Exited session.", reqID)
} else if err != nil {
logger.Errorf("SFTP request %s: Server completed with error %s", reqID, err)
}
......@@ -82,7 +82,7 @@ func (fs *sftpHandler) Filecmd(r *sftp.Request) (err error) {
case "Setstat":
return
case "Rename":
logger.Debug("%s=>%s", r.Filepath, r.Target)
logger.Debugf("%s=>%s", r.Filepath, r.Target)
return fs.Rename(r.Filepath, r.Target)
case "Rmdir":
err = fs.RemoveDirectory(r.Filepath)
......@@ -91,7 +91,7 @@ func (fs *sftpHandler) Filecmd(r *sftp.Request) (err error) {
case "Mkdir":
err = fs.MkdirAll(r.Filepath)
case "Symlink":
logger.Debug("%s=>%s", r.Filepath, r.Target)
logger.Debugf("%s=>%s", r.Filepath, r.Target)
err = fs.Symlink(r.Filepath, r.Target)
default:
return
......
......@@ -61,6 +61,11 @@ func (w *WrapperSession) Read(p []byte) (int, error) {
}
func (w *WrapperSession) Close() error {
select {
case <-w.closed:
return nil
default:
}
err := w.inWriter.Close()
w.initReadPip()
return err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment