mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-24 22:45:17 +02:00
fix sftp.exe client to transfer files in binary mode
sftp.exe client were adding crlf to each lines of files. It should transfer in binary mode. set O_BINARY flag on in _open calls.
This commit is contained in:
parent
5b06ebbbb5
commit
cae05764b0
@ -1313,7 +1313,7 @@ do_download(struct sftp_conn *conn, const char *remote_path,
|
|||||||
#ifdef WIN32_FIXME
|
#ifdef WIN32_FIXME
|
||||||
|
|
||||||
local_fd = _open(local_path,
|
local_fd = _open(local_path,
|
||||||
O_WRONLY | O_CREAT | (resume_flag ? 0 : O_TRUNC), mode | S_IWUSR);
|
O_WRONLY | O_CREAT | O_BINARY | (resume_flag ? 0 : O_TRUNC), mode | S_IWUSR);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
local_fd = open(local_path,
|
local_fd = open(local_path,
|
||||||
@ -1704,7 +1704,7 @@ do_upload(struct sftp_conn *conn, const char *local_path,
|
|||||||
|
|
||||||
#ifdef WIN32_FIXME
|
#ifdef WIN32_FIXME
|
||||||
|
|
||||||
if ((local_fd = _open(local_path, O_RDONLY, 0)) == -1) {
|
if ((local_fd = _open(local_path, O_RDONLY | O_BINARY, 0)) == -1) {
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user