components/wget/patches/CVE-2010-2252.patch
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Wed, 29 Aug 2012 11:05:56 -0700
changeset 957 255465c5756f
parent 115 c360825c3a3f
permissions -rw-r--r--
Close of build 04.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
103
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     1
diff -rcu wget-1.12.orig/doc/wget.texi wget-1.12/doc/wget.texi
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     2
--- wget-1.12.orig/doc/wget.texi	Fri Sep  4 14:22:04 2009
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     3
+++ wget-1.12/doc/wget.texi	Tue Feb 15 03:26:00 2011
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     4
@@ -1487,6 +1487,13 @@
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     5
 @code{Content-Disposition} headers to describe what the name of a
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     6
 downloaded file should be.
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     7
 
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     8
[email protected] Trust server names
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     9
[email protected] --trust-server-names
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    10
+
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    11
+If this is set to on, on a redirect the last component of the
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    12
+redirection URL will be used as the local file name.  By default it is
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    13
+used the last component in the original URL.
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    14
+
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    15
 @cindex authentication
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    16
 @item --auth-no-challenge
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    17
 
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    18
@@ -2799,6 +2806,10 @@
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    19
 Turn on recognition of the (non-standard) @samp{Content-Disposition}
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    20
 HTTP header---if set to @samp{on}, the same as @samp{--content-disposition}.
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    21
 
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    22
[email protected] trust_server_names = on/off
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    23
+If set to on, use the last component of a redirection URL for the local
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    24
+file name.
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    25
+
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    26
 @item continue = on/off
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    27
 If set to on, force continuation of preexistent partially retrieved
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    28
 files.  See @samp{-c} before setting it.
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    29
diff -rcu wget-1.12.orig/src/http.c wget-1.12/src/http.c
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    30
--- wget-1.12.orig/src/http.c	Mon Sep 21 20:02:18 2009
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    31
+++ wget-1.12/src/http.c	Tue Feb 15 03:26:00 2011
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    32
@@ -2410,8 +2410,9 @@
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    33
 /* The genuine HTTP loop!  This is the part where the retrieval is
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    34
    retried, and retried, and retried, and...  */
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    35
 uerr_t
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    36
-http_loop (struct url *u, char **newloc, char **local_file, const char *referer,
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    37
-           int *dt, struct url *proxy, struct iri *iri)
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    38
+http_loop (struct url *u, struct url *original_url, char **newloc,
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    39
+           char **local_file, const char *referer, int *dt, struct url *proxy,
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    40
+           struct iri *iri)
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    41
 {
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    42
   int count;
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    43
   bool got_head = false;         /* used for time-stamping and filename detection */
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    44
@@ -2457,7 +2458,8 @@
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    45
     }
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    46
   else if (!opt.content_disposition)
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    47
     {
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    48
-      hstat.local_file = url_file_name (u);
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    49
+      hstat.local_file =
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    50
+        url_file_name (opt.trustservernames ? u : original_url);
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    51
       got_name = true;
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    52
     }
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    53
 
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    54
@@ -2497,7 +2499,7 @@
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    55
 
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    56
   /* Send preliminary HEAD request if -N is given and we have an existing
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    57
    * destination file. */
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    58
-  file_name = url_file_name (u);
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    59
+  file_name = url_file_name (opt.trustservernames ? u : original_url);
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    60
   if (opt.timestamping
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    61
       && !opt.content_disposition
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    62
       && file_exists_p (file_name))
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    63
diff -rcu wget-1.12.orig/src/http.h wget-1.12/src/http.h
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    64
--- wget-1.12.orig/src/http.h	Fri Sep  4 09:31:54 2009
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    65
+++ wget-1.12/src/http.h	Tue Feb 15 03:26:00 2011
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    66
@@ -33,8 +33,8 @@
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    67
 
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    68
 struct url;
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    69
 
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    70
-uerr_t http_loop (struct url *, char **, char **, const char *, int *,
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    71
-		  struct url *, struct iri *);
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    72
+uerr_t http_loop (struct url *, struct url *, char **, char **, const char *,
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    73
+                  int *, struct url *, struct iri *);
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    74
 void save_cookies (void);
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    75
 void http_cleanup (void);
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    76
 time_t http_atotm (const char *);
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    77
diff -rcu wget-1.12.orig/src/init.c wget-1.12/src/init.c
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    78
--- wget-1.12.orig/src/init.c	Mon Sep 21 20:02:41 2009
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    79
+++ wget-1.12/src/init.c	Tue Feb 15 03:26:00 2011
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    80
@@ -243,6 +243,7 @@
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    81
   { "timeout",          NULL,                   cmd_spec_timeout },
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    82
   { "timestamping",     &opt.timestamping,      cmd_boolean },
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    83
   { "tries",            &opt.ntry,              cmd_number_inf },
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    84
+  { "trustservernames", &opt.trustservernames,  cmd_boolean },
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    85
   { "useproxy",         &opt.use_proxy,         cmd_boolean },
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    86
   { "user",             &opt.user,              cmd_string },
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    87
   { "useragent",        NULL,                   cmd_spec_useragent },
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    88
diff -rcu wget-1.12.orig/src/main.c wget-1.12/src/main.c
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    89
--- wget-1.12.orig/src/main.c	Mon Sep 21 20:03:11 2009
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    90
+++ wget-1.12/src/main.c	Tue Feb 15 03:26:00 2011
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    91
@@ -266,6 +266,7 @@
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    92
     { "timeout", 'T', OPT_VALUE, "timeout", -1 },
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    93
     { "timestamping", 'N', OPT_BOOLEAN, "timestamping", -1 },
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    94
     { "tries", 't', OPT_VALUE, "tries", -1 },
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    95
+    { "trust-server-names", 0, OPT_BOOLEAN, "trustservernames", -1 },
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    96
     { "user", 0, OPT_VALUE, "user", -1 },
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    97
     { "user-agent", 'U', OPT_VALUE, "useragent", -1 },
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    98
     { "verbose", 'v', OPT_BOOLEAN, "verbose", -1 },
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    99
@@ -675,6 +676,8 @@
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   100
     N_("\
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   101
   -I,  --include-directories=LIST  list of allowed directories.\n"),
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   102
     N_("\
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   103
+  --trust-server-names  use the name specified by the redirection url last component.\n"),
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   104
+    N_("\
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   105
   -X,  --exclude-directories=LIST  list of excluded directories.\n"),
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   106
     N_("\
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   107
   -np, --no-parent                 don't ascend to the parent directory.\n"),
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   108
diff -rcu wget-1.12.orig/src/options.h wget-1.12/src/options.h
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   109
--- wget-1.12.orig/src/options.h	Mon Sep 21 20:03:47 2009
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   110
+++ wget-1.12/src/options.h	Tue Feb 15 03:26:00 2011
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   111
@@ -242,6 +242,7 @@
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   112
   char *encoding_remote;
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   113
   char *locale;
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   114
 
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   115
+  bool trustservernames;
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   116
 #ifdef __VMS
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   117
   int ftp_stmlf;                /* Force Stream_LF format for binary FTP. */
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   118
 #endif /* def __VMS */
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   119
diff -rcu wget-1.12.orig/src/retr.c wget-1.12/src/retr.c
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   120
--- wget-1.12.orig/src/retr.c	Fri Sep  4 09:31:54 2009
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   121
+++ wget-1.12/src/retr.c	Tue Feb 15 03:26:00 2011
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   122
@@ -689,7 +689,8 @@
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   123
 #endif
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   124
       || (proxy_url && proxy_url->scheme == SCHEME_HTTP))
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   125
     {
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   126
-      result = http_loop (u, &mynewloc, &local_file, refurl, dt, proxy_url, iri);
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   127
+      result = http_loop (u, orig_parsed, &mynewloc, &local_file, refurl, dt,
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   128
+                          proxy_url, iri);
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   129
     }
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   130
   else if (u->scheme == SCHEME_FTP)
461b591f782f 7008670 CVE-2010-2252 wget problems with 3xx redirection
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   131
     {