[Twisted-Python] Couple of conch bug-fixes

John Popplewell john at johnnypops.demon.co.uk
Sun Mar 11 09:51:18 MDT 2007


Hi,

I've been using the Twisted SSH server and client code and found a
couple of bugs in the SFTP code:

In 'twisted/conch/ssh/filetransfer.py':

  FILEXFER_ATTR_ACMODTIME     0x00000009

should be replaced by this:

  FILEXFER_ATTR_ACMODTIME     0x00000008

According to this document anyway:
http://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-5

This makes the 'preserve timestamp' option in WinSCP3 work.


In 'twisted/conch/scripts/cftp.py':

  d = self.client.openFile(remote, filetransfer.FXF_WRITE|filetransfer.FXF_CREAT, {})

should be replaced, in *both* places, by something like this:

  flags = filetransfer.FXF_WRITE|filetransfer.FXF_CREAT|filetransfer.FXF_TRUNC
  d = self.client.openFile(remote, flags, {})

This makes file tranfer work when an *existing* file is being
over-written by a *smaller* file. It took me a while to find this one :-)

Hope this is a suitable place for these minor fixes,

regards,
John.





More information about the Twisted-Python mailing list