Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 220669

Summary: net-misc/d4x-2.5.7.1-r2: Content-Disposition bug
Product: Gentoo Linux Reporter: Nao Nakashima <nao.nakashima>
Component: Current packagesAssignee: Desktop Misc. Team <desktop-misc>
Status: RESOLVED WONTFIX    
Severity: minor    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 271645    
Attachments: bugfix

Description Nao Nakashima 2008-05-06 19:49:53 UTC
When file name in "Content-Disposition:" header same as in URL (or entered manually in "Save download to file" field) d4x is trying to copy file to itself that results to trunicating file to 0 bytes.

Reproducible: Always

Steps to Reproduce:
1.
-------------------------------
cd htdocs
cat << EOF > download.php
<?php 
header('Content-Disposition: attachment; filename=file.zip');
readfile('av-330.gif');
?>
EOF

echo "RewriteRule ^file.zip$ /download.php" >> .htaccess
-------------------------------

2. Create av-330.gif ;)

3. Add "http://host/file.zip" download in d4x
Actual Results:  
The file has zero size.

Expected Results:  
d4x must check that filenames are equal.

Patch attached. Actually it adds only one line;)
I`m tried to contact developer of d4x, but he didn`t answer.
Comment 1 Nao Nakashima 2008-05-06 19:51:53 UTC
Created attachment 152159 [details, diff]
bugfix
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2009-08-10 08:41:17 UTC
gone