| Summary: | scp truncates file when copying file over itself | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Christof Schmitt <christof.schmitt> | ||||
| Component: | scp | Assignee: | Assigned to nobody <unassigned-bugs> | ||||
| Status: | CLOSED FIXED | ||||||
| Severity: | major | CC: | djm, dtucker | ||||
| Priority: | P5 | ||||||
| Version: | 9.0p1 | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 3418 | ||||||
| Attachments: |
|
||||||
|
Description
Christof Schmitt
2022-05-11 08:19:00 AEST
Not sure that assignment to an external contributor is a good idea :) Created attachment 3594 [details]
don't overwrite files
This fixes it for 'scp foo localhost:foo' and 'scp localhost:foo foo', but not 'scp localhost:foo localhost:foo'
This fix has been committed and will be in OpenSSH 9.1, due in a few months. commit 56a0697fe079ff3e1ba30a2d5c26b5e45f7b71f8 (HEAD -> master, origin/master, origin/HEAD) Author: djm@openbsd.org <djm@openbsd.org> Date: Fri May 13 06:31:50 2022 +0000 upstream: arrange for scp, when in sftp mode, to not ftruncate(3) files early previous behavious of unconditionally truncating the destination file would cause "scp ~/foo localhost:" and "scp localhost:foo ~/" to delete all the contents of their destination. spotted by solene@ sthen@, also bz3431; ok dtucker@ OpenBSD-Commit-ID: ca39fdd39e0ec1466b9666f15cbcfddea6aaa179 Closing bugs from openssh-9.1 release cycle OpenSSH 9.3 has been released. Close resolved bugs |