1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

ssh-libssh: do not specify O_APPEND when not in append mode

Specifying O_APPEND in conjunction with O_TRUNC and O_CREAT does not
make much sense. And this combination of flags is not accepted by all
SFTP servers (at least not Apache SSHD).

Fixes #4147
Closes #4148
This commit is contained in:
Felix Hädicke 2019-07-24 11:47:51 +02:00 committed by Daniel Stenberg
parent a55edcea65
commit 6261749510
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -1119,7 +1119,7 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
flags = O_WRONLY|O_APPEND;
else
/* Clear file before writing (normal behaviour) */
flags = O_WRONLY|O_APPEND|O_CREAT|O_TRUNC;
flags = O_WRONLY|O_CREAT|O_TRUNC;
if(sshc->sftp_file)
sftp_close(sshc->sftp_file);