Debugging SFTP question

Christian Heinrich christian.heinrich at cmlh.id.au
Sat May 4 11:33:18 EST 2013


Graeme,

I have encountered a similar issue before i.e.
https://speakerdeck.com/cmlh/ssh

Is the SSH client different from the OpenSSH server i.e. Ubuntu 12.04?

Are the bzip2 files created on a different host to that of the SSH client?

Also, is the 32-bit CRC calculated by bzip2 different before and after it
is transferred?  I would recommend that you also calculate the hash of the
bzip2 file using http://www.openssl.org/docs/apps/dgst.html or similar.

On Sat, May 4, 2013 at 8:58 AM, Graeme Wallace <
graeme.wallace at farecompare.com> wrote:

> I'm using the openssh that comes with Ubuntu 12.04 so thats 5.9p1
>
> I'm trying to debug why i'm getting corrupt bzip2 files when they are
> transferred using sftp. The corruption doesnt happen on every file. I'm
> running debug mode on sftp-server, but when doing that i see output like
> the following for both valid and corrupt files,
>
>
> May  3 18:50:55 ftp-new sftp-server[16955]: debug3: request 1470: sent
> status 0
> May  3 18:50:55 ftp-new sftp-server[16955]: sent status Success
> May  3 18:50:55 ftp-new sftp-server[16955]: debug1: request 1471: write
> "/home/travelport2/OTH_ALL_20130503_2247_V3.part" (handle 0) off 48103424
> len 32768
> May  3 18:50:55 ftp-new sftp-server[16955]: debug3: request 1471: sent
> status 0
> May  3 18:50:55 ftp-new sftp-server[16955]: sent status Success
> May  3 18:50:55 ftp-new sftp-server[16955]: debug1: request 1472: write
> "/home/travelport2/OTH_ALL_20130503_2247_V3.part" (handle 0) off 48136192
> len 32768
> May  3 18:50:55 ftp-new sftp-server[16955]: debug3: request 1472: sent
> status 0
> May  3 18:51:01 ftp-new sftp-server[16955]: debug1: request 3383: write
> "/home/travelport2/OTH_ALL_20130503_2247_V3.part" (handle 0) off 110755840
> len 32768
> May  3 18:51:01 ftp-new sftp-server[16955]: debug3: request 3383: sent
> status 0
> May  3 18:51:01 ftp-new sftp-server[16955]: sent status Success
> May  3 18:51:01 ftp-new sftp-server[16955]: debug1: request 3384: write
> "/home/travelport2/OTH_ALL_20130503_2247_V3.part" (handle 0) off 110788608
> len 32768
> May  3 18:51:01 ftp-new sftp-server[16955]: debug3: request 3384: sent
> status 0
> May  3 18:51:01 ftp-new sftp-server[16955]: sent status Success
> May  3 18:51:01 ftp-new sftp-server[16955]: debug1: request 3385: write
> "/home/travelport2/OTH_ALL_20130503_2247_V3.part" (handle 0) off 110821376
> len 32768
>
>
> Is it normal for request numbers and offsets to suddenly jump massively ?
> From looking at the code, it would seem the server is merely responding to
> the request from the client, but I dont understand what would make the
> client 'skip' from offset 48136192 to offset 110755840 and from request
> 1472 to 3383 - as the client code looks like its just it plods through the
> file.
>
> Is this just a red herring ?
>
> --
> Graeme Wallace
> CTO
> FareCompare.com
> O: 972 588 1414
> M: 214 681 9018
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-unix-dev at mindrot.org
> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
>



-- 
Regards,
Christian Heinrich

http://cmlh.id.au/contact


More information about the openssh-unix-dev mailing list