1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-23 16:48:49 -05:00

ftp: move ftp_ccc in under featureflag

Commit e91e481612 moved ftp_ccc in under
the FTP featureflag in the UserDefined struct, but vtls callsites were
still using it unprotected.

Closes #3912
Fixes: https://curl.haxx.se/dev/log.cgi?id=20190520044705-29865
Reviewed-by: Daniel Stenberg, Marcel Raad
This commit is contained in:
Daniel Gustafsson 2019-05-21 09:38:11 +02:00
parent 31b77c1877
commit 8986d3c6f4
4 changed files with 8 additions and 0 deletions

View File

@ -1266,8 +1266,10 @@ static int Curl_gskit_shutdown(struct connectdata *conn, int sockindex)
if(!BACKEND->handle) if(!BACKEND->handle)
return 0; return 0;
#ifndef CURL_DISABLE_FTP
if(data->set.ftp_ccc != CURLFTPSSL_CCC_ACTIVE) if(data->set.ftp_ccc != CURLFTPSSL_CCC_ACTIVE)
return 0; return 0;
#endif
close_one(connssl, conn, sockindex); close_one(connssl, conn, sockindex);
rc = 0; rc = 0;

View File

@ -1640,6 +1640,7 @@ static int Curl_gtls_shutdown(struct connectdata *conn, int sockindex)
int retval = 0; int retval = 0;
struct Curl_easy *data = conn->data; struct Curl_easy *data = conn->data;
#ifndef CURL_DISABLE_FTP
/* This has only been tested on the proftpd server, and the mod_tls code /* This has only been tested on the proftpd server, and the mod_tls code
sends a close notify alert without waiting for a close notify alert in sends a close notify alert without waiting for a close notify alert in
response. Thus we wait for a close notify alert from the server, but response. Thus we wait for a close notify alert from the server, but
@ -1647,6 +1648,7 @@ static int Curl_gtls_shutdown(struct connectdata *conn, int sockindex)
if(data->set.ftp_ccc == CURLFTPSSL_CCC_ACTIVE) if(data->set.ftp_ccc == CURLFTPSSL_CCC_ACTIVE)
gnutls_bye(BACKEND->session, GNUTLS_SHUT_WR); gnutls_bye(BACKEND->session, GNUTLS_SHUT_WR);
#endif
if(BACKEND->session) { if(BACKEND->session) {
ssize_t result; ssize_t result;

View File

@ -1308,6 +1308,7 @@ static int Curl_ossl_shutdown(struct connectdata *conn, int sockindex)
int err; int err;
bool done = FALSE; bool done = FALSE;
#ifndef CURL_DISABLE_FTP
/* This has only been tested on the proftpd server, and the mod_tls code /* This has only been tested on the proftpd server, and the mod_tls code
sends a close notify alert without waiting for a close notify alert in sends a close notify alert without waiting for a close notify alert in
response. Thus we wait for a close notify alert from the server, but response. Thus we wait for a close notify alert from the server, but
@ -1315,6 +1316,7 @@ static int Curl_ossl_shutdown(struct connectdata *conn, int sockindex)
if(data->set.ftp_ccc == CURLFTPSSL_CCC_ACTIVE) if(data->set.ftp_ccc == CURLFTPSSL_CCC_ACTIVE)
(void)SSL_shutdown(BACKEND->handle); (void)SSL_shutdown(BACKEND->handle);
#endif
if(BACKEND->handle) { if(BACKEND->handle) {
buffsize = (int)sizeof(buf); buffsize = (int)sizeof(buf);

View File

@ -2963,8 +2963,10 @@ static int Curl_sectransp_shutdown(struct connectdata *conn, int sockindex)
if(!BACKEND->ssl_ctx) if(!BACKEND->ssl_ctx)
return 0; return 0;
#ifndef CURL_DISABLE_FTP
if(data->set.ftp_ccc != CURLFTPSSL_CCC_ACTIVE) if(data->set.ftp_ccc != CURLFTPSSL_CCC_ACTIVE)
return 0; return 0;
#endif
Curl_sectransp_close(conn, sockindex); Curl_sectransp_close(conn, sockindex);