This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 229744 - wget -P not working with wget version > wget-1.10.2-3.2.1.i386.rpm
wget -P not working with wget version > wget-1.10.2-3.2.1.i386.rpm
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: wget (Show other bugs)
6
All Linux
medium Severity medium
: ---
: ---
Assigned To: Karsten Hopp
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-22 22:20 EST by Itamar Reis Peixoto
Modified: 2013-01-09 23:12 EST (History)
1 user (show)

See Also:
Fixed In Version: 1.10.2-15
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-04 09:04:51 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Itamar Reis Peixoto 2007-02-22 22:20:30 EST
Description of problem:

wget doesn't work with -P


Version-Release number of selected component (if applicable):

1.10.2-8.fc6.1

How reproducible:

try with wget version 1.10.2-8.fc6.1

wget -P /etc http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.20.1.tar.bz2

and try same command with wget version wget-1.10.2-3.2.1.i386.rpm

with wget-1.10.2-3.2.1.i386.rpm works, the file was downloaded on /etc, with 
newer versions ( 1.10.2-8.fc6.1 ) the file will be downloaded on current 
directory

more details here.

http://netenberg.com/forum/viewtopic.php?t=5430
Comment 1 Craig Hughes 2007-10-03 18:15:03 EDT
The problem appears to be coming from this snippet in wget-1.10.2-to11.patch:

+  /* Determine the local filename if needed. Notice that if -O is used 
+   * hstat.local_file is set by http_loop to the argument of -O. */
+  if (!hs->local_file)
+    {
+      /* Honor Content-Disposition whether possible. */
+      if (!opt.content_disposition
+          || !resp_header_copy (resp, "Content-Disposition", 
+                                hdrval, sizeof (hdrval))
+          || !parse_content_disposition (hdrval, &hs->local_file))
+        {
+          /* The Content-Disposition header is missing or broken. 
+           * Choose unique file name according to given URL. */
+          hs->local_file = url_file_name (u);
+        }
+    }

The patch is honoring -O as mentioned in the comments, but not honoring -P when
there's a Content-disposition header in the HTTP response.
Comment 2 Karsten Hopp 2007-10-04 09:04:51 EDT
the to11 patch messed some other things up as well and has been removed in the
latest packages.

Note You need to log in before you can comment on or make changes to this bug.