]> git.ipfire.org Git - thirdparty/openssh-portable.git/commit
upstream: arrange for scp, when in sftp mode, to not ftruncate(3) files
authordjm@openbsd.org <djm@openbsd.org>
Fri, 13 May 2022 06:31:50 +0000 (06:31 +0000)
committerDamien Miller <djm@mindrot.org>
Fri, 13 May 2022 07:00:56 +0000 (17:00 +1000)
commit56a0697fe079ff3e1ba30a2d5c26b5e45f7b71f8
treedfdc7bf1433d7bd162e70d08b023f429ca8881e7
parentfbcef70c2832712f027bccea1aa9bc4b4103da93
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
scp.c
sftp-client.c
sftp-client.h
sftp.c