wget: bump version to 1.17.1lilik-openwrt-22.03
@ -1,132 +0,0 @@ | |||
From 1cb3af1e5b392ac2fae6d9ed8b5d7be399d9f37e Mon Sep 17 00:00:00 2001 | |||
From: Ygal Blum <address@hidden> | |||
Date: Tue, 24 Nov 2015 11:24:54 +0200 | |||
Subject: [PATCH] Fix compilation when without-ssl is selected | |||
--- | |||
src/ftp.c | 2 ++ | |||
src/main.c | 12 ++++++++++-- | |||
src/recur.c | 6 +++++- | |||
src/retr.c | 18 +++++++++++++++--- | |||
src/url.c | 6 +++++- | |||
5 files changed, 37 insertions(+), 7 deletions(-) | |||
diff --git a/src/ftp.c b/src/ftp.c | |||
index 80420ef..5394b71 100644 | |||
--- a/src/ftp.c | |||
+++ b/src/ftp.c | |||
@@ -393,7 +393,9 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread, | |||
if (!(cmd & DO_LOGIN)) | |||
{ | |||
csock = con->csock; | |||
+#ifdef HAVE_SSL | |||
using_data_security = con->st & DATA_CHANNEL_SECURITY; | |||
+#endif | |||
} | |||
else /* cmd & DO_LOGIN */ | |||
{ | |||
diff --git a/src/main.c b/src/main.c | |||
index 61a157a..4641008 100644 | |||
--- a/src/main.c | |||
+++ b/src/main.c | |||
@@ -1842,13 +1842,21 @@ only if outputting to a regular file.\n")); | |||
else | |||
{ | |||
if ((opt.recursive || opt.page_requisites) | |||
- && ((url_scheme (*t) != SCHEME_FTP && url_scheme (*t) != SCHEME_FTPS) | |||
+ && ((url_scheme (*t) != SCHEME_FTP | |||
+#ifdef HAVE_SSL | |||
+ && url_scheme (*t) != SCHEME_FTPS | |||
+#endif | |||
+ ) | |||
|| url_uses_proxy (url_parsed))) | |||
{ | |||
int old_follow_ftp = opt.follow_ftp; | |||
/* Turn opt.follow_ftp on in case of recursive FTP retrieval */ | |||
- if (url_scheme (*t) == SCHEME_FTP || url_scheme (*t) == SCHEME_FTPS) | |||
+ if (url_scheme (*t) == SCHEME_FTP | |||
+#ifdef HAVE_SSL | |||
+ || url_scheme (*t) == SCHEME_FTPS | |||
+#endif | |||
+ ) | |||
opt.follow_ftp = 1; | |||
retrieve_tree (url_parsed, NULL); | |||
diff --git a/src/recur.c b/src/recur.c | |||
index 25cdbb7..b212ec6 100644 | |||
--- a/src/recur.c | |||
+++ b/src/recur.c | |||
@@ -610,7 +610,11 @@ download_child (const struct urlpos *upos, struct url *parent, int depth, | |||
u_scheme_like_http = schemes_are_similar_p (u->scheme, SCHEME_HTTP); | |||
/* 1. Schemes other than HTTP are normally not recursed into. */ | |||
- if (!u_scheme_like_http && !((u->scheme == SCHEME_FTP || u->scheme == SCHEME_FTPS) && opt.follow_ftp)) | |||
+ if (!u_scheme_like_http && !((u->scheme == SCHEME_FTP | |||
+#ifdef HAVE_SSL | |||
+ || u->scheme == SCHEME_FTPS | |||
+#endif | |||
+ ) && opt.follow_ftp)) | |||
{ | |||
DEBUGP (("Not following non-HTTP schemes.\n")); | |||
reason = WG_RR_NONHTTP; | |||
diff --git a/src/retr.c b/src/retr.c | |||
index 318b09c..a6a9bd7 100644 | |||
--- a/src/retr.c | |||
+++ b/src/retr.c | |||
@@ -837,7 +837,11 @@ retrieve_url (struct url * orig_parsed, const char *origurl, char **file, | |||
FTP. In these cases we must decide whether the text is HTML | |||
according to the suffix. The HTML suffixes are `.html', | |||
`.htm' and a few others, case-insensitive. */ | |||
- if (redirection_count && local_file && (u->scheme == SCHEME_FTP || u->scheme == SCHEME_FTPS)) | |||
+ if (redirection_count && local_file && (u->scheme == SCHEME_FTP | |||
+#ifdef HAVE_SSL | |||
+ || u->scheme == SCHEME_FTPS | |||
+#endif | |||
+ )) | |||
{ | |||
if (has_html_suffix_p (local_file)) | |||
*dt |= TEXTHTML; | |||
@@ -1099,12 +1103,20 @@ retrieve_from_file (const char *file, bool html, int *count) | |||
proxy = getproxy (cur_url->url); | |||
if ((opt.recursive || opt.page_requisites) | |||
- && ((cur_url->url->scheme != SCHEME_FTP && cur_url->url->scheme != SCHEME_FTPS) || proxy)) | |||
+ && ((cur_url->url->scheme != SCHEME_FTP | |||
+#ifdef HAVE_SSL | |||
+ && cur_url->url->scheme != SCHEME_FTPS | |||
+#endif | |||
+ ) || proxy)) | |||
{ | |||
int old_follow_ftp = opt.follow_ftp; | |||
/* Turn opt.follow_ftp on in case of recursive FTP retrieval */ | |||
- if (cur_url->url->scheme == SCHEME_FTP || cur_url->url->scheme == SCHEME_FTPS) | |||
+ if (cur_url->url->scheme == SCHEME_FTP | |||
+#ifdef HAVE_SSL | |||
+ || cur_url->url->scheme == SCHEME_FTPS | |||
+#endif | |||
+ ) | |||
opt.follow_ftp = 1; | |||
status = retrieve_tree (parsed_url ? parsed_url : cur_url->url, | |||
diff --git a/src/url.c b/src/url.c | |||
index 56079cd..c62867f 100644 | |||
--- a/src/url.c | |||
+++ b/src/url.c | |||
@@ -1787,7 +1787,11 @@ path_simplify (enum url_scheme scheme, char *path) | |||
for (--t; t > beg && t[-1] != '/'; t--) | |||
; | |||
} | |||
- else if (scheme == SCHEME_FTP || scheme == SCHEME_FTPS) | |||
+ else if (scheme == SCHEME_FTP | |||
+#ifdef HAVE_SSL | |||
+ || scheme == SCHEME_FTPS | |||
+#endif | |||
+ ) | |||
{ | |||
/* If we're at the beginning, copy the "../" literally | |||
and move the beginning so a later ".." doesn't remove | |||
-- | |||
1.9.1 | |||
@ -1,147 +0,0 @@ | |||
From 2cfcadf5e6d5c444765aa460915ae27109a8dbce Mon Sep 17 00:00:00 2001 | |||
From: Darshit Shah <darnir@gmail.com> | |||
Date: Mon, 16 Nov 2015 23:16:25 +0000 | |||
Subject: Fix compile error when IPv6 is disabled | |||
* src/ftp-basic.c: The code for the new FTPS functionality was unintentionally | |||
inside a #ifdef IPV6 block. Move the code around so that it is defined even when | |||
IPV6 isn't used | |||
--- | |||
diff --git a/src/ftp-basic.c b/src/ftp-basic.c | |||
index bcb7847..378374c 100644 | |||
--- a/src/ftp-basic.c | |||
+++ b/src/ftp-basic.c | |||
@@ -429,6 +429,65 @@ ip_address_to_eprt_repr (const ip_address *addr, int port, char *buf, | |||
buf[buflen - 1] = '\0'; | |||
} | |||
+/* Bind a port and send the appropriate PORT command to the FTP | |||
+ server. Use acceptport after RETR, to get the socket of data | |||
+ connection. */ | |||
+uerr_t | |||
+ftp_eprt (int csock, int *local_sock) | |||
+{ | |||
+ uerr_t err; | |||
+ char *request, *respline; | |||
+ ip_address addr; | |||
+ int nwritten; | |||
+ int port; | |||
+ /* Must contain the argument of EPRT (of the form |af|addr|port|). | |||
+ * 4 chars for the | separators, INET6_ADDRSTRLEN chars for addr | |||
+ * 1 char for af (1-2) and 5 chars for port (0-65535) */ | |||
+ char bytes[4 + INET6_ADDRSTRLEN + 1 + 5 + 1]; | |||
+ | |||
+ /* Get the address of this side of the connection. */ | |||
+ if (!socket_ip_address (csock, &addr, ENDPOINT_LOCAL)) | |||
+ return FTPSYSERR; | |||
+ | |||
+ /* Setting port to 0 lets the system choose a free port. */ | |||
+ port = 0; | |||
+ | |||
+ /* Bind the port. */ | |||
+ *local_sock = bind_local (&addr, &port); | |||
+ if (*local_sock < 0) | |||
+ return FTPSYSERR; | |||
+ | |||
+ /* Construct the argument of EPRT (of the form |af|addr|port|). */ | |||
+ ip_address_to_eprt_repr (&addr, port, bytes, sizeof (bytes)); | |||
+ | |||
+ /* Send PORT request. */ | |||
+ request = ftp_request ("EPRT", bytes); | |||
+ nwritten = fd_write (csock, request, strlen (request), -1); | |||
+ if (nwritten < 0) | |||
+ { | |||
+ xfree (request); | |||
+ fd_close (*local_sock); | |||
+ return WRITEFAILED; | |||
+ } | |||
+ xfree (request); | |||
+ /* Get appropriate response. */ | |||
+ err = ftp_response (csock, &respline); | |||
+ if (err != FTPOK) | |||
+ { | |||
+ fd_close (*local_sock); | |||
+ return err; | |||
+ } | |||
+ if (*respline != '2') | |||
+ { | |||
+ xfree (respline); | |||
+ fd_close (*local_sock); | |||
+ return FTPPORTERR; | |||
+ } | |||
+ xfree (respline); | |||
+ return FTPOK; | |||
+} | |||
+#endif | |||
+ | |||
#ifdef HAVE_SSL | |||
/* | |||
* The following three functions defined into this #ifdef block | |||
@@ -542,65 +601,6 @@ bail: | |||
} | |||
#endif /* HAVE_SSL */ | |||
-/* Bind a port and send the appropriate PORT command to the FTP | |||
- server. Use acceptport after RETR, to get the socket of data | |||
- connection. */ | |||
-uerr_t | |||
-ftp_eprt (int csock, int *local_sock) | |||
-{ | |||
- uerr_t err; | |||
- char *request, *respline; | |||
- ip_address addr; | |||
- int nwritten; | |||
- int port; | |||
- /* Must contain the argument of EPRT (of the form |af|addr|port|). | |||
- * 4 chars for the | separators, INET6_ADDRSTRLEN chars for addr | |||
- * 1 char for af (1-2) and 5 chars for port (0-65535) */ | |||
- char bytes[4 + INET6_ADDRSTRLEN + 1 + 5 + 1]; | |||
- | |||
- /* Get the address of this side of the connection. */ | |||
- if (!socket_ip_address (csock, &addr, ENDPOINT_LOCAL)) | |||
- return FTPSYSERR; | |||
- | |||
- /* Setting port to 0 lets the system choose a free port. */ | |||
- port = 0; | |||
- | |||
- /* Bind the port. */ | |||
- *local_sock = bind_local (&addr, &port); | |||
- if (*local_sock < 0) | |||
- return FTPSYSERR; | |||
- | |||
- /* Construct the argument of EPRT (of the form |af|addr|port|). */ | |||
- ip_address_to_eprt_repr (&addr, port, bytes, sizeof (bytes)); | |||
- | |||
- /* Send PORT request. */ | |||
- request = ftp_request ("EPRT", bytes); | |||
- nwritten = fd_write (csock, request, strlen (request), -1); | |||
- if (nwritten < 0) | |||
- { | |||
- xfree (request); | |||
- fd_close (*local_sock); | |||
- return WRITEFAILED; | |||
- } | |||
- xfree (request); | |||
- /* Get appropriate response. */ | |||
- err = ftp_response (csock, &respline); | |||
- if (err != FTPOK) | |||
- { | |||
- fd_close (*local_sock); | |||
- return err; | |||
- } | |||
- if (*respline != '2') | |||
- { | |||
- xfree (respline); | |||
- fd_close (*local_sock); | |||
- return FTPPORTERR; | |||
- } | |||
- xfree (respline); | |||
- return FTPOK; | |||
-} | |||
-#endif | |||
- | |||
/* Similar to ftp_port, but uses `PASV' to initiate the passive FTP | |||
transfer. Reads the response from server and parses it. Reads the | |||
host and port addresses and returns them. */ | |||
-- | |||
cgit v0.9.0.2 |