bugGNU Wget - Bugs: bug #24862, --content-disposition doesn't work...

 
 

bug #24862: --content-disposition doesn't work with HTTP authentication.

Submitted by:  None
Submitted on:  Mon 17 Nov 2008 08:47:16 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Privacy: PublicAssigned to: None
Originator Name: Adam BuchbinderOriginator Email: -unavailable-
Open/Closed: ClosedRelease: trunk
Operating System: GNU/LinuxReproducibility: Every Time
Fixed Release: NonePlanned Release: 1.12
Regression: NoneWork Required: 0 - Hours
Patch Included: Yes

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Tue 08 Sep 2009 06:10:10 AM UTC, comment #6:

Test added in ad9d6e2d0810.

Micah Cowan <micahcowan>
Tue 18 Aug 2009 03:42:30 AM UTC, comment #5:

Should get a test, to ensure we don't re-introduce this bug, especially with the fix to bug 27192.

Micah Cowan <micahcowan>
Tue 18 Aug 2009 03:33:25 AM UTC, comment #4:

(This fix ended up breaking NTLM, due to the fact that Content-Length was being checked before it had been parsed)

Micah Cowan <micahcowan>
Tue 02 Dec 2008 06:29:03 AM UTC, comment #3:

Fixed for mainline in d2359cb4c145.

Micah Cowan <micahcowan>
Wed 26 Nov 2008 11:21:59 PM UTC, comment #2:

Bug Confirmed.

Problem lies in http.c:gethttp() :
For handling "Content-Disposition" header Wget sends first an "HEAD" request. During this first request hs->local_file is NULL and that triggers checking for "Content-Disposition" presence and usability (around line 1824 in http.c).
If Wget receive a 401 reply notifying that ANY authentication (not just Basic) scheme isn't fulfilled, there's no "Content-Disposition" header and thus wget fallback on the default file name.
During the next loop in gethttp() hs->local_file won't be NULL and "Content-Disposition" presence won't be checked keeping default file name.

Temporary fix: using "wget --content-disposition --auth-no-challange" does not trigger this bug.

Placing the code that loops in case of unauthenticated request before file name check solves this issue. Only tested with Basic Auth.

Patch attached.

(file #16928)

Saint Xavier <sxav>
Mon 17 Nov 2008 09:17:31 PM UTC, comment #1:

I'm attaching a patch to add a new test to tests/. I apologize for the several commits rolled into one here; this is my first time using Mercurial, so please let me know if there's anything I can do to make the patch a better one.

(file #16872)

Adam Buchbinder <adambuchbinder>
Mon 17 Nov 2008 08:47:16 PM UTC, original submission:

I'm running the following wget, pulled from Hg today and compiled on Ubuntu Hardy:

GNU Wget 1.12-devel (5220752ead16)
Options : +digest +ipv6 +nls +ntlm +opie +md5/openssl -gnutls
+openssl +gettext
Wgetrc : /usr/local/etc/wgetrc (system)
Locale : /usr/local/share/locale
Compile : gcc -DHAVE_CONFIG_H
-DSYSTEM_WGETRC="/usr/local/etc/wgetrc"
-DLOCALEDIR="/usr/local/share/locale" -I. -I../lib -g -O2
Link : gcc -g -O2 -lssl -lcrypto -ldl -lrt ftp-opie.o openssl.o
http-ntlm.o gen-md5.o ../lib/libgnu.a

wget --content-disposition does not name the resultant file in accordance with the Content-Disposition header, if HTTP Basic authentication is performed.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #16928:  bug24862_fix.patch added by sxav (8KiB - application/octet-stream)
file #16872:  add-content-disposition-basic-auth-test.patch added by adambuchbinder (5KiB - text/x-diff - Patch against current Hg to add a test for this issue.)
file #16867:  content-disposition-auth.txt added by None (3KiB - text/plain - Output of "wget --content-disposition -d "http://user:pass@localhost/cdtest-auth.php" -o content-disposition-auth.txt")

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by sxav (Updated the item)
  • -unavailable- added by micahcowan (Updated the item)
  • -unavailable- added by adambuchbinder (Updated the item)
  • -unavailable- added by None (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 21 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 08 Sep 2009 06:10:10 AM UTCmicahcowanStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Tue 18 Aug 2009 03:42:29 AM UTCmicahcowanSeverity5 - Blocker=>3 - Normal
      Priority9 - Immediate=>5 - Normal
      StatusFixed=>Ready For Test
      Assigned tosxav=>None
      Open/ClosedClosed=>Open
    Tue 02 Dec 2008 06:29:03 AM UTCmicahcowanStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Wed 26 Nov 2008 11:27:47 PM UTCmicahcowanPriority7 - High=>9 - Immediate
    Wed 26 Nov 2008 11:21:59 PM UTCsxavAttached File-=>Added bug24862_fix.patch, #16928
      StatusNeeds Investigation=>Ready For Test
      Assigned toNone=>sxav
      Patch IncludedNo=>Yes
    Tue 18 Nov 2008 07:26:05 PM UTCmicahcowanSeverity3 - Normal=>5 - Blocker
      Priority5 - Normal=>7 - High
      StatusNone=>Needs Investigation
      Planned ReleaseNone=>1.12
      Work RequiredNone=>0 - Hours
    Mon 17 Nov 2008 09:17:31 PM UTCadambuchbinderAttached File-=>Added add-content-disposition-basic-auth-test.patch, #16872
    Mon 17 Nov 2008 08:47:17 PM UTCNoneAttached File-=>Added content-disposition-auth.txt, #16867

    Back to the top


    Powered by Savane 3.1-cleanup1