[Bug 3504] file content lost after scp to same file at localhost

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Mon Nov 21 09:19:57 AEDT 2022


https://bugzilla.mindrot.org/show_bug.cgi?id=3504

Damien Miller <djm at mindrot.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
                 CC|                            |djm at mindrot.org

--- Comment #2 from Damien Miller <djm at mindrot.org> ---
This was fixed in OpenSSH 9.1

commit 56a0697fe079ff3e1ba30a2d5c26b5e45f7b71f8
Author: djm at openbsd.org <djm at 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

-- 
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list