From 67958755aa129006ea3f0a5458d89013a1949d8a Mon Sep 17 00:00:00 2001 From: Tomas Hozza Date: Fri, 12 Jul 2013 09:01:01 +0200 Subject: [PATCH] Fix bug when authenticating using user:password@url syntax (#912358) Signed-off-by: Tomas Hozza --- ...set_sock_to_-1_if_no_persistent_conn.patch | 32 +++++++++++++++++++ wget.spec | 3 ++ 2 files changed, 35 insertions(+) create mode 100644 wget-1.14-set_sock_to_-1_if_no_persistent_conn.patch diff --git a/wget-1.14-set_sock_to_-1_if_no_persistent_conn.patch b/wget-1.14-set_sock_to_-1_if_no_persistent_conn.patch new file mode 100644 index 0000000..9ee37e8 --- /dev/null +++ b/wget-1.14-set_sock_to_-1_if_no_persistent_conn.patch @@ -0,0 +1,32 @@ +From 8760123cee87e07a276b8b13ef48ada3a490ad47 Mon Sep 17 00:00:00 2001 +From: Tomas Hozza +Date: Thu, 11 Jul 2013 11:22:43 +0000 +Subject: Set sock variable to -1 if no persistent conn exists + +Wget should set sock variable to -1 if no persistent +connection exists. Function persistent_available_p() +tests persistent connection but if test_socket_open() +fails it closes the socket but will not set sock variable +to -1. After returning from persistent_available_p() +it is possible that sock has still value of already +closed connection. + +Signed-off-by: Tomas Hozza +--- +diff --git a/src/http.c b/src/http.c +index 669f0fe..a693355 100644 +--- a/src/http.c ++++ b/src/http.c +@@ -1983,6 +1983,10 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy, + exec_name, quote (relevant->host)); + return HOSTERR; + } ++ else if (sock != -1) ++ { ++ sock = -1; ++ } + } + + if (sock < 0) +-- +cgit v0.9.0.2 diff --git a/wget.spec b/wget.spec index 7367b2b..9c682a4 100644 --- a/wget.spec +++ b/wget.spec @@ -16,6 +16,7 @@ Patch6: wget-1.14-texi2pod_error_perl518.patch Patch7: wget-1.14-fix-double-free-of-iri-orig_url.patch Patch8: wget-1.14-Fix-deadcode-and-possible-NULL-use.patch Patch9: wget-1.14-doc-missing-opts-and-fix-preserve-permissions.patch +Patch10: wget-1.14-set_sock_to_-1_if_no_persistent_conn.patch Provides: webclient Provides: bundled(gnulib) @@ -44,6 +45,7 @@ support for Proxy servers, and configurability. %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 %build if pkg-config openssl ; then @@ -84,6 +86,7 @@ rm -rf $RPM_BUILD_ROOT - Fix deadcode and possible use of NULL in vprintf (#913153) - Add documentation for --regex-type and --preserve-permissions - Fix --preserve-permissions to work as documented (and expected) +- Fix bug when authenticating using user:password@url syntax (#912358) * Wed Jul 10 2013 Tomas Hozza - 1.14-7 - Fix double free of iri->orig_url (#981778)