From 0c51036eb6ddef50a1730bdd33a4388b35343125 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 8 Feb 2021 16:21:31 +0100 Subject: ftp: never set data->set.ftp_append outside setopt Since the set value then risks getting used like that when the easy handle is reused by the application. Also: renamed the struct field from 'ftp_append' to 'remote_append' since it is also used for SSH protocols. Closes #6579 --- lib/vssh/libssh.c | 2 +- lib/vssh/libssh2.c | 2 +- lib/vssh/wolfssh.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/vssh') diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 08896ab5b..dfdef12af 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -1224,7 +1224,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) } } - if(data->set.ftp_append) + if(data->set.remote_append) /* Try to open for append, but create if nonexisting */ flags = O_WRONLY|O_CREAT|O_APPEND; else if(data->state.resume_from > 0) diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 3130dcc74..dbbeb2322 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -1880,7 +1880,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) } } - if(data->set.ftp_append) + if(data->set.remote_append) /* Try to open for append, but create if nonexisting */ flags = LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT|LIBSSH2_FXF_APPEND; else if(data->state.resume_from > 0) diff --git a/lib/vssh/wolfssh.c b/lib/vssh/wolfssh.c index 6020180a5..c0de33984 100644 --- a/lib/vssh/wolfssh.c +++ b/lib/vssh/wolfssh.c @@ -585,7 +585,7 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data, bool *block) } } - if(data->set.ftp_append) + if(data->set.remote_append) /* Try to open for append, but create if nonexisting */ flags = WOLFSSH_FXF_WRITE|WOLFSSH_FXF_CREAT|WOLFSSH_FXF_APPEND; else if(data->state.resume_from > 0) -- cgit v1.2.1