Closed Bug 551658 Opened 15 years ago Closed 14 years ago

[@ nsIFile::createUnique] crashes with long parent directory names

Categories

(Core :: XPCOM, defect)

defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla1.9.3a5

People

(Reporter: Paolo, Assigned: Paolo)

References

Details

(Keywords: crash)

Crash Data

Attachments

(1 file)

nsIFile::createUnique may crash with long parent directory names. See the attached patch and test case for details. Unfortunately I can't compile nor test the part of the patch for operating systems other than Windows (after the #else), I'd need help from someone who can build on other platforms.
Attachment #431821 - Flags: review?(benjamin)
Attachment #431821 - Flags: review?(benjamin) → review+
Thanks for the review! Just to be safe before check-in, did you verify that this compiles on at least one platform other than Windows?
oh, i should note that i think we should probably not go this way :). Mozilla no longer supports w9x, which means we should be able to use \\?\ notation if we need long file paths....
(In reply to comment #1) > Thanks for the review! Just to be safe before check-in, did you verify > that this compiles on at least one platform other than Windows? I guess I'll just mark this for check-in with a note.
Keywords: checkin-needed
Whiteboard: [c-n: try and compile on non-Windows first, if affordable]
Assignee: nobody → paolo.02.prg
I threw this at tryserver, will post the results.
again, this is really the wrong way to fix the problem.
(In reply to comment #2) > Mozilla no longer supports w9x, which means we should be able to use \\?\ > notation if we need long file paths.... Although the Windows API allows for the creation of files with very long names, doing this is not recommended, as the both the shell and most command line tools will generally refuse to work with paths longer than 260 characters. createUnique is used by the file download code to generate a unique name when downloading automatically, and we don't want such downloaded file to become unmanageable if a long name is suggested by a "Content-Disposition" header. Besides, I don't know how well long names are handled on platforms other than Windows.
"fairly well". minus some stupid issues that are really outside of scope (posix sucks)
(In reply to comment #4) > I threw this at tryserver, will post the results. Seems like the tryserver build succeeded? http://tinderbox.mozilla.org/showbuilds.cgi?tree=MozillaTry&maxdate=1269813016&hours=24&legend=0&norules=1
Whiteboard: [c-n: try and compile on non-Windows first, if affordable]
Severity: normal → critical
Keywords: crash
Summary: nsIFile::createUnique crashes with long parent directory names → [@ nsIFile::createUnique] crashes with long parent directory names
Keywords: checkin-needed
Still waiting for check-in?
Keywords: checkin-needed
Blocks: 561472
Status: NEW → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
Crash Signature: [@ nsIFile::createUnique]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: