scp.py icon indicating copy to clipboard operation
scp.py copied to clipboard

Various fixes

Open adiroiban opened this issue 10 years ago • 7 comments

I gave this code a try and here is a branch with quick and dirty fixes.

channel.recv() method is (ab)used in the code and already receive data is not buffered to be used in next phase/step of SCP protocol.

In the same time, when remote scp command fails, the error is not converted into a SCPException.

I have just sent to code, in case someone find it useful.... it does not contain any tests.

Many thanks for the work on this module!

Cheers

adiroiban avatar May 19 '14 14:05 adiroiban

Thanks. These look good, and I'll go over them as soon as I can.

jbardin avatar May 19 '14 15:05 jbardin

No hurry. For now, I am just trying scp.py ... in case I will stick with it I will need to write some tests as the patch is just a dirty hack.

adiroiban avatar May 19 '14 16:05 adiroiban

Hi, sorry this got lost in the py3k fray.

Are these patches something you're still using? If so, would you mind trying to rebase them, against master, and seeing if you can get a failing->passing testcase for the changes?

If not, I'll close this work on these possible issues in a new patch.

Thanks!

jbardin avatar Mar 02 '15 16:03 jbardin

Hi. I am still using the changes as part of automated functional test suite.

I will try to find time to update the code and add tests.

Thanks!

adiroiban avatar Mar 03 '15 10:03 adiroiban

Hi.. i did an intial merge with master but my branch is broken.

I have created this patch while working on a custom SCP implementation so many of the errors are hard to reproduce using the OpenSSH server as they are only triggered by custom SSH servers (ex one which does not allow exec subsystem) or which don't behave as the original scp command. ... so I found it hard to write automated test using the current code. It will need a custom SSH server with a custom server side SCP implementation.

While trying to understand how I should set up the test environment I tried to improve the dev documenation...


Can you please make a new release and maybe also keep a record of public changes in a release-notes / changelog file? ... and create a tag for each release :)


btw I run latest scp.py on Linux/Windows/OSX and all looks good. So I think that you have already included in master the important bits of unicode path handling and empty files

Thanks!

adiroiban avatar Mar 04 '15 11:03 adiroiban

Ah yes, that explains why I couldn't replicate the problems you had listed, this was created by using openssh's scp as a reference.

Does your ssh/scp implementation interoperate correctly with openssh's?

For testing, I would use a fake scp server that sends back pre-scripted responses which are known to break the current implementation.

Thanks!

jbardin avatar Mar 04 '15 14:03 jbardin

I did not had time to update the tests..

I have pushed a new commit in which instead for failing if command does not end with \n it continue to read more :) ... the current fix is still naive

adiroiban avatar Mar 29 '16 13:03 adiroiban