Skip to content

Commit 225d92a

Browse files
committed
missed one, and explicit statusOK return
1 parent b40f93f commit 225d92a

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

server.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,13 @@ func (srv *Server) handle(req sshfx.Packet, hint []byte, maxDataLen uint32) (ssh
622622

623623
case *openssh.FStatVFSExtendedPacket:
624624
if statvfser, ok := file.(StatVFSFileHandler); ok {
625-
return statvfser.StatVFS()
625+
resp, err := statvfser.StatVFS()
626+
if err != nil {
627+
// We have to convert typed-nil to untyped-nil.
628+
return nil, err
629+
}
630+
631+
return resp, nil
626632
}
627633

628634
if statvfser, ok := srv.Handler.(StatVFSServerHandler); ok {
@@ -747,7 +753,8 @@ func (srv *Server) handle(req sshfx.Packet, hint []byte, maxDataLen uint32) (ssh
747753
return nil, io.ErrShortWrite
748754
}
749755

750-
return nil, nil
756+
// explicitly return statusOK here, rather than both nil.
757+
return statusOK, nil
751758

752759
case *sshfx.FStatPacket:
753760
attrs, err := file.Stat()

0 commit comments

Comments
 (0)