Closed Bug 116210 Opened 23 years ago Closed 23 years ago

File upload stalls when file name is invalid

Categories

(Core :: DOM: Core & HTML, defect)

x86
All
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla0.9.8

People

(Reporter: neil, Assigned: hwaara)

References

Details

(Keywords: regression, relnote)

Attachments

(1 file)

Using Build ID: 2001121803
I was trying to submit a patch to Bugzilla but mistyped the filename.
Previous versions of mozilla submitted the form and Bugzilla traps the error.
However today the trobber just spins sending data to bugzilla.mozilla.org...
->>
Assignee: rods → alexsavulov
Worse, this includes *empty* filenames, which causes some serious breakage in a
case like 

<FORM METHOD="post" ACTION="test.cgi" ENCTYPE="multipart/form-data">     
                                                                
Upload a file: <INPUT TYPE="file" NAME="file"><BR>                 
                                                    
Or type some content: <INPUT TYPE="text" NAME="text"><BR>          
                                                          
<INPUT TYPE="submit">                                                    
                
</FORM>  

this causes Zope site to break, for example, and probably many other things.
Let me try that again. :) Also, read "Zope *sites*", not just "site".


<FORM METHOD=post ACTION=test.cgi ENCTYPE="multipart/form-data">
Upload a file: <INPUT TYPE="file" NAME="file"><BR>
Or type some content: <INPUT TYPE="text" NAME="text"><BR>
<INPUT TYPE="submit">
</FORM>              

Oh, and also, not just Win95. I see the same behavior on Linux and Win98.
Minimal test example: http://jadzia.bu.edu/~mattdm/test/mozform/test.html

Leave the "upload a file" box empty, or put in an invalid filename, and     
mozilla just spins -- even if you have typed into the "or type some content" 
text input.

test.cgi is

#!/usr/bin/perl
use CGI qw/:standard/;
print header, "Ok."


by the way. (But it doesn't really matter, since the request is never sent.)
ccing hwaara and brendan.  hwaara, did you change the logic in your leak fix 
(like adding a break on read failure or something like that)?
Attached patch PatchSplinter Review
Does this patch fix things?  I'm not in a position to be able to try this patch
right now.
Yes, that patch does indeed fix the problem.

It also means that incorrect filenames are silently ignored, but that's a
less-severe problem in my estimation.

Related -- bug #82634 (file upload doesn't check user-entered filename [form sub])
Can I get r/sr on the patch?
Assignee: alexsavulov → hwaara
Keywords: regression
OS: Windows 95 → All
Target Milestone: --- → mozilla0.9.8
Comment on attachment 62547 [details] [diff] [review]
Patch

So is ignoring read errors really the right thing?  Or should the code avoid
hanging, but report the failure?

/be
It certainly shouldn't report anything if the file input box just happens to be
blank!
The whole function needs cleanup and rewwriting.  See bug 115815....  if we want 
to unregress this in the meantime, that's fine, but the whole thing needs 
de-nsFileSpec'ing and the like.. in the process, I'll put in reasonable error 
handling.
Right, this code sucks pretty much right now, and my intention with this patch
is just to fix this regression.  There's another bug logged for rewriting it and
cleaning up the logic.

Bzbarsky, r=?  Brendan, sr=?
Comment on attachment 62547 [details] [diff] [review]
Patch

r=bzbarsky
I'll reinstate the error-check when I clean up.
Attachment #62547 - Flags: review+
*** Bug 116829 has been marked as a duplicate of this bug. ***
Component: HTML Form Controls → Form Submission
Resummarizing to include my dupe.
Summary: File upload stalls when file name is invalid → File upload stalls when file name is invalid or on EACCES
Comment on attachment 62547 [details] [diff] [review]
Patch

sr=jst
Attachment #62547 - Flags: superreview+
fix checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
*** Bug 116822 has been marked as a duplicate of this bug. ***
*** Bug 116494 has been marked as a duplicate of this bug. ***
*** Bug 116873 has been marked as a duplicate of this bug. ***
*** Bug 116603 has been marked as a duplicate of this bug. ***
*** Bug 116749 has been marked as a duplicate of this bug. ***
*** Bug 116901 has been marked as a duplicate of this bug. ***
*** Bug 116900 has been marked as a duplicate of this bug. ***
*** Bug 114777 has been marked as a duplicate of this bug. ***
*** Bug 116681 has been marked as a duplicate of this bug. ***
*** Bug 116936 has been marked as a duplicate of this bug. ***
*** Bug 117079 has been marked as a duplicate of this bug. ***
Suggested relnote entry (Please add it to 0.9.7 Release Notes, in the Known
Problems=>Navigator section) :

<h4>Forms</h4><p>Forms which have a field to upload files ( i.e., a field with
TYPE set to 'file' ) will hang when sending the data if the file field is blank
or has an invalid file.  This affects sites using Zope or IMP webmail, among
others. If you need this feature, you can download a nightly build <a
href="http://ftp.mozilla.org/pub/mozilla/nightly/latest/">here</a>. (Bug <a
href="http://bugzilla.mozilla.org/show_bug.cgi?id=116210">116210</a>)</p>
DAMN! Please remove the "( i.e., a field with TYPE set to 'file' )" section...

Sorry for the spam

The correct message is: 

Suggested relnote entry (Please add it to 0.9.7 Release Notes, in the Known
Problems=>Navigator section) :

<h4>Forms</h4><p>Forms which have a field to upload files will hang when sending
the data if the file field is blank or has an invalid file.  This affects sites
using Zope or IMP webmail, among others. If you need this feature, you can
download a nightly build <a
href="http://ftp.mozilla.org/pub/mozilla/nightly/latest/">here</a>. (Bug <a
href="http://bugzilla.mozilla.org/show_bug.cgi?id=116210">116210</a>)</p>

Mozilla 0.9.7 is out the door, and this will be fixed in the next release. No
need to relnote it.
relnoted for 0.9.7. We can remove the relnote from full release notes when 0.9.8 comes around.
Keywords: relnote
*** Bug 117101 has been marked as a duplicate of this bug. ***
*** Bug 117124 has been marked as a duplicate of this bug. ***
*** Bug 117110 has been marked as a duplicate of this bug. ***
*** Bug 117182 has been marked as a duplicate of this bug. ***
*** Bug 117227 has been marked as a duplicate of this bug. ***
*** Bug 117237 has been marked as a duplicate of this bug. ***
*** Bug 117364 has been marked as a duplicate of this bug. ***
*** Bug 117352 has been marked as a duplicate of this bug. ***
*** Bug 117424 has been marked as a duplicate of this bug. ***
*** Bug 117306 has been marked as a duplicate of this bug. ***
*** Bug 117535 has been marked as a duplicate of this bug. ***
*** Bug 117591 has been marked as a duplicate of this bug. ***
*** Bug 117748 has been marked as a duplicate of this bug. ***
*** Bug 117847 has been marked as a duplicate of this bug. ***
*** Bug 117898 has been marked as a duplicate of this bug. ***
*** Bug 117899 has been marked as a duplicate of this bug. ***
*** Bug 117897 has been marked as a duplicate of this bug. ***
*** Bug 117947 has been marked as a duplicate of this bug. ***
*** Bug 117942 has been marked as a duplicate of this bug. ***
*** Bug 117959 has been marked as a duplicate of this bug. ***
*** Bug 118366 has been marked as a duplicate of this bug. ***
*** Bug 118330 has been marked as a duplicate of this bug. ***
*** Bug 118446 has been marked as a duplicate of this bug. ***
*** Bug 118469 has been marked as a duplicate of this bug. ***
verified on linux cvs build, waiting for verification on mac and windows...
*** Bug 118614 has been marked as a duplicate of this bug. ***
*** Bug 118667 has been marked as a duplicate of this bug. ***
*** Bug 118695 has been marked as a duplicate of this bug. ***
*** Bug 118861 has been marked as a duplicate of this bug. ***
*** Bug 119004 has been marked as a duplicate of this bug. ***
*** Bug 119602 has been marked as a duplicate of this bug. ***
*** Bug 119643 has been marked as a duplicate of this bug. ***
*** Bug 119780 has been marked as a duplicate of this bug. ***
*** Bug 119839 has been marked as a duplicate of this bug. ***
*** Bug 119921 has been marked as a duplicate of this bug. ***
*** Bug 117582 has been marked as a duplicate of this bug. ***
*** Bug 119878 has been marked as a duplicate of this bug. ***
*** Bug 120088 has been marked as a duplicate of this bug. ***
*** Bug 120269 has been marked as a duplicate of this bug. ***
*** Bug 120490 has been marked as a duplicate of this bug. ***
*** Bug 120726 has been marked as a duplicate of this bug. ***
It's...er....back. Linux 2002011806. Uploading a file without read perms. No
errors. Just sits there.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Please file a new bug.  This bug is fixed.  Thanks.
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
A bit of research shows that:

1)  Uploading a nonexistent file is indeed fixed.

2)  Uploading a file with no read perms does not work.  In fact it never worked.
    I just regressed builds back to September at one-week intervals and it fails
    in them all.

Jeremy, please comment in this bug with the bug number of the new bug you file.
I originally did. It was duped here. Is this bug not covering permission
problems, only invalid names? Half of the dupes are for permission problems.

I'll reopen the original bug I filed for this - bug 116829:
  Attaching a file to form submission w/o read permission hangs file upload

Undoing my resummary of this bug, as it was never taken into account.
Summary: File upload stalls when file name is invalid or on EACCES → File upload stalls when file name is invalid
*** Bug 120805 has been marked as a duplicate of this bug. ***
*** Bug 120825 has been marked as a duplicate of this bug. ***
*** Bug 121086 has been marked as a duplicate of this bug. ***
*** Bug 121096 has been marked as a duplicate of this bug. ***
*** Bug 121195 has been marked as a duplicate of this bug. ***
*** Bug 121450 has been marked as a duplicate of this bug. ***
*** Bug 122058 has been marked as a duplicate of this bug. ***
*** Bug 122058 has been marked as a duplicate of this bug. ***
*** Bug 122058 has been marked as a duplicate of this bug. ***
*** Bug 122275 has been marked as a duplicate of this bug. ***
*** Bug 122350 has been marked as a duplicate of this bug. ***
*** Bug 122354 has been marked as a duplicate of this bug. ***
*** Bug 122396 has been marked as a duplicate of this bug. ***
*** Bug 122724 has been marked as a duplicate of this bug. ***
*** Bug 122771 has been marked as a duplicate of this bug. ***
*** Bug 123004 has been marked as a duplicate of this bug. ***
*** Bug 119449 has been marked as a duplicate of this bug. ***
*** Bug 133186 has been marked as a duplicate of this bug. ***
verifying
Status: RESOLVED → VERIFIED
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: