summaryrefslogtreecommitdiff
path: root/sftp-client.h
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2022-05-13 06:31:50 +0000
committerDamien Miller <djm@mindrot.org>2022-05-13 17:00:56 +1000
commit56a0697fe079ff3e1ba30a2d5c26b5e45f7b71f8 (patch)
treedfdc7bf1433d7bd162e70d08b023f429ca8881e7 /sftp-client.h
parentfbcef70c2832712f027bccea1aa9bc4b4103da93 (diff)
downloadopenssh-git-56a0697fe079ff3e1ba30a2d5c26b5e45f7b71f8.tar.gz
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
Diffstat (limited to 'sftp-client.h')
-rw-r--r--sftp-client.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/sftp-client.h b/sftp-client.h
index 282a4c70..7ca6e8ad 100644
--- a/sftp-client.h
+++ b/sftp-client.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-client.h,v 1.36 2022/03/31 03:07:03 djm Exp $ */
+/* $OpenBSD: sftp-client.h,v 1.37 2022/05/13 06:31:50 djm Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
@@ -141,28 +141,29 @@ int do_fsync(struct sftp_conn *conn, u_char *, u_int);
* Download 'remote_path' to 'local_path'. Preserve permissions and times
* if 'pflag' is set
*/
-int do_download(struct sftp_conn *, const char *, const char *,
- Attrib *, int, int, int);
+int do_download(struct sftp_conn *, const char *, const char *, Attrib *,
+ int, int, int, int);
/*
* Recursively download 'remote_directory' to 'local_directory'. Preserve
* times if 'pflag' is set
*/
-int download_dir(struct sftp_conn *, const char *, const char *,
- Attrib *, int, int, int, int, int);
+int download_dir(struct sftp_conn *, const char *, const char *, Attrib *,
+ int, int, int, int, int, int);
/*
* Upload 'local_path' to 'remote_path'. Preserve permissions and times
* if 'pflag' is set
*/
-int do_upload(struct sftp_conn *, const char *, const char *, int, int, int);
+int do_upload(struct sftp_conn *, const char *, const char *,
+ int, int, int, int);
/*
* Recursively upload 'local_directory' to 'remote_directory'. Preserve
* times if 'pflag' is set
*/
-int upload_dir(struct sftp_conn *, const char *, const char *, int, int, int,
- int, int);
+int upload_dir(struct sftp_conn *, const char *, const char *,
+ int, int, int, int, int, int);
/*
* Download a 'from_path' from the 'from' connection and upload it to