| Summary: | scp -3 doesn't give an error on missing source directory | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Jakub Jelen <jjelen> | ||||
| Component: | scp | Assignee: | Assigned to nobody <unassigned-bugs> | ||||
| Status: | CLOSED WONTFIX | ||||||
| Severity: | normal | CC: | djm, jrwren | ||||
| Priority: | P5 | ||||||
| Version: | 6.7p1 | ||||||
| Hardware: | Other | ||||||
| OS: | Linux | ||||||
| Attachments: |
|
||||||
|
Description
Jakub Jelen
2015-01-14 20:36:06 AEDT
Created attachment 2600 [details]
Patch to show errors from remote ends
To catch up with Red Hat bugzilla: Implementation of extended remote to remote is sending error messages back and forth from one remote to the other and none of them is writing them out. It seems half-baked.
This can be solved by catching such messages in initiator process (or writing them out in the remote processes, but it requires changes on server side).
After some digging in this case I managed to make stream redirection and catching errors in the initiator process. This change doesn't require any changes on server side so there are no drawbacks about backward compatibility.
For now it is fully functional implementation. Some notes for future self (or anyone having look into it):
* Follows scp state protocol in simple FSM
* It would be nicer to use atomicio everywhere (I read all line instead of reading byte after byte as implementation on server side)
* Progress-meter is working again
* Still doesn't work using password authentication on both ends, since the prompts are print over each other.
* There is some overhead, but if you aim for speed you will not use -3 option
I tried my best to come up with quality code, but feel free to comment if you find some problem or something is not clear. Patch can be applied to upstream sources
*** Bug 2761 has been marked as a duplicate of this bug. *** We're moving away from rcp-based scp, and the new sftp-based scp does show the error message Closing bugs from OpenSSH 9.1 release cycle |