diff options
author | Felix Hädicke <felixhaedicke@web.de> | 2019-07-24 11:47:51 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-07-25 23:29:21 +0200 |
commit | 62617495102c60124db8a909f592f063e38a89aa (patch) | |
tree | 9b74befea07d8c653af7211860baa80f467fc5ef | |
parent | a55edcea6530e369b467b00208c58f73f3609307 (diff) |
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
-rw-r--r-- | lib/ssh-libssh.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ssh-libssh.c b/lib/ssh-libssh.c index ca1337677..879358eba 100644 --- a/lib/ssh-libssh.c +++ b/lib/ssh-libssh.c @@ -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); |