Bug 436822 - wget ignores '-P' when Content-Disposition set on server
Summary: wget ignores '-P' when Content-Disposition set on server
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: wget
Version: 5.1
Hardware: i686
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Karsten Hopp
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-03-10 17:34 UTC by Jari Takkala
Modified: 2016-03-22 13:18 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-02 09:38:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1280 0 normal SHIPPED_LIVE wget bug fix update 2009-09-01 09:48:43 UTC

Description Jari Takkala 2008-03-10 17:34:59 UTC
Description of problem:
If the server returns the header Content-Disposition, and the -P argument is
supplied to wget, then wget will ignore the -P argument and store the file in
the current working directory.

Version-Release number of selected component (if applicable):
# rpm -q -i wget
Name        : wget                         Relocations: (not relocatable)
Version     : 1.10.2                            Vendor: Red Hat, Inc.
Release     : 7.el5                         Build Date: Tue 09 Jan 2007 11:12:03
AM EST
[snip]

# wget --version
GNU Wget 1.10.2 (Red Hat modified)

How reproducible:
Pass the '-P' argument and a directory path to wget. Also pass a URL for which
the server will reply with the Content-Disposition header.

Steps to Reproduce:
1. For example, create a directory /home/user/tmp and run a server on localhost
port 80 with netcat.
/home/user$ mkdir tmp
/root# nc -l -v 127.0.0.1 80

2. Connect to the server with wget and instruct it to store the downloaded file
in the tmp directory.
/home/user$ wget -P tmp http://127.0.0.1/foobar

3. On the netcat server side, paste in content similar to below.

HTTP/1.1 200 OK
Date: Mon, 10 Mar 2008 14:57:36 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Content-Disposition: attachment; filename=foobar
Content-Length: 10
Connection: close
Content-Type: application/gzip

1234567890

Actual results:
The file is stored in the current working directory of wget (/home/user).

Expected results:
The file should be stored in the relative directory of tmp (/home/user/tmp).

Additional info:
This argument worked correctly on RHEL 4. If you omit the Content-Disposition
line, then the file is correctly stored in /home/user/tmp.

Comment 1 Phil Knirsch 2008-04-29 14:46:53 UTC
After talking with the developer about this bug i'm proposing it for RHEL-5.3
granting Devel ACK for it.

Read ya, Phil


Comment 7 errata-xmlrpc 2009-09-02 09:38:46 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1280.html


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