← Commit list

237a900bc

Denys Vlasenko
Denys Vlasenko
2018-02-08
SUCCESS Duration: 145s

Subject

wget: do not ask for TLS-encrypted downloads on plain ftp:// URLs

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

networking/wget.c+7 -5
@@ -807,11 +807,13 @@ static FILE* prepare_ftp_session(FILE **dfpp, struct host_info *target, len_and_
*dfpp = open_socket(lsa);
#if ENABLE_FEATURE_WGET_HTTPS
- /* "PROT P" enables encryption of data stream.
- * Without it (or with "PROT C"), data is sent unencrypted.
- */
- if (ftpcmd("PROT P", NULL, sfp) == 200)
- spawn_ssl_client(target->host, fileno(*dfpp), /*flags*/ 0);
+ if (target->protocol == P_FTPS) {
+ /* "PROT P" enables encryption of data stream.
+ * Without it (or with "PROT C"), data is sent unencrypted.
+ */
+ if (ftpcmd("PROT P", NULL, sfp) == 200)
+ spawn_ssl_client(target->host, fileno(*dfpp), /*flags*/ 0);
+ }
#endif
if (G.beg_range != 0) {