~ubuntu-branches/ubuntu/hardy/wget/hardy

« back to all changes in this revision

Viewing changes to debian/patches/wget-dont_pattern_match_server_redirects

  • Committer: Bazaar Package Importer
  • Author(s): Noèl Köthe
  • Date: 2005-10-13 16:59:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051013165903-3e12j4gn6znkhmdb
Tags: 1.10.2-1
new upstream release which fixes a NTLM Buffer Overflow Vulnerability

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh -e
2
 
## PATCHNAME by NAME <EMAIL>
3
 
##
4
 
## DP: DESCRIPTION
5
 
 
6
 
if [ $# -lt 1 ]; then
7
 
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
8
 
    exit 1
9
 
fi
10
 
 
11
 
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
12
 
patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
13
 
 
14
 
case "$1" in
15
 
       -patch) patch $patch_opts -p1 < $0;;
16
 
       -unpatch) patch $patch_opts -p1 -R < $0;;
17
 
        *)
18
 
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
19
 
                exit 1;;
20
 
esac
21
 
 
22
 
exit 0
23
 
 
24
 
@DPATCH@
25
 
diff -ur wget-1.10.orig/src/retr.c wget-1.10/src/retr.c
26
 
--- wget-1.10.orig/src/retr.c  (revision 1817)
27
 
+++ wget-1.10/src/retr.c  (working copy)
28
 
@@ -668,14 +668,16 @@
29
 
     }
30
 
   else if (u->scheme == SCHEME_FTP)
31
 
     {
32
 
-      /* If this is a redirection, we must not allow recursive FTP
33
 
-         retrieval, so we save recursion to oldrec, and restore it
34
 
-         later.  */
35
 
-      int oldrec = opt.recursive;
36
 
+      /* If this is a redirection, temporarily turn off opt.ftp_glob
37
 
+         and opt.recursive, both being undesirable when following
38
 
+         redirects.  */
39
 
+      int oldrec = opt.recursive, oldglob = opt.ftp_glob;
40
 
       if (redirection_count)
41
 
-        opt.recursive = 0;
42
 
+        opt.recursive = opt.ftp_glob = 0;
43
 
+
44
 
       result = ftp_loop (u, dt, proxy_url);
45
 
       opt.recursive = oldrec;
46
 
+      opt.ftp_glob = oldglob;
47
 
 
48
 
       /* There is a possibility of having HTTP being redirected to
49
 
         FTP.  In these cases we must decide whether the text is HTML
50
 
 
51
 
diff -ur wget-1.10.orig/src/http.c wget-1.10/src/http.c
52
 
--- wget-1.10.orig/src/http.c  (revision 1817)
53
 
+++ wget-1.10/src/http.c  (working copy)
54
 
@@ -1996,7 +1996,7 @@
55
 
   *newloc = NULL;
56
 
 
57
 
   /* Warn on (likely bogus) wildcard usage in HTTP.  */
58
 
-  if (has_wildcards_p (u->path))
59
 
+  if (opt.ftp_glob && has_wildcards_p (u->path))
60
 
     logputs (LOG_VERBOSE, _("Warning: wildcards not supported in HTTP.\n"));
61
 
 
62
 
   xzero (hstat);
63