Subject: ssh filexfer

From: "Richard Whalen" <[email-masked]>
Date: Mon, 24 Oct 2005 10:56:01 -0400

I ran across a problem last week that doesn't appear to be covered in the latest draft.

Customer was doing a text transfer of a file.  The program does an SSH_FXP_FSETSTAT at the end with file size specified.  This ended up as an ftruncate, which returned an error because the file was opened for record access and the offset specified wasn't a record boundary.

I've modified my implementation to ignore the setting of the file length in this situation.

I think that we need some text in either the SSH_FXP_OPEN or SSH_FXP_FSETSTAT stating the it may not be a legal operation to attempt to set the length for a file that is opened in TEXT transfer mode.

----------------------
Richard Whalen
Process Software

---

From: Jeffrey Hutzelman <[email-masked]>
Date: Mon, 24 Oct 2005 10:58:30 -0400

On Monday, October 24, 2005 10:56:01 AM -0400 Richard Whalen 
<[email-masked]> wrote:

> Customer was doing a text transfer of a file.  The program does an
> SSH_FXP_FSETSTAT at the end with file size specified.  This ended up as
> an ftruncate, which returned an error because the file was opened for
> record access and the offset specified wasn't a record boundary.

It could have been worse -- the specified size could have happened to be on 
a record boundary, but still too small.

Perhaps clients transferring files in text mode SHOULD NOT attempt to set 
the file size.  It seems like doing so is likely to do more harm than good.

-- Jeffrey T. Hutzelman (N3NHS) <[email-masked]>
   Sr. Research Systems Programmer
   School of Computer Science - Research Computing Facility
   Carnegie Mellon University - Pittsburgh, PA