Open Bug 366325 Opened 18 years ago Updated 2 years ago

temporary filenames do not handle multiple extensions (.tar.gz)

Categories

(Core :: XPCOM, defect)

x86
Linux
defect

Tracking

()

People

(Reporter: alex, Unassigned)

References

Details

Attachments

(1 file, 2 obsolete files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1.1) Gecko/20060601 Firefox/2.0.0.1 (Ubuntu-edgy)
Build Identifier: version 1.5.0.9 (20070103)

Howdy guys,

I am reporting a bug on behalf of manu, he has reported that when you open an attachment to view it with a multiple extension it gets named foo.tar.gz first time, foo.tar-1.gz second, foo.tar-2.gz the third time, and so on..

The original report can be found here..

https://launchpad.net/ubuntu/+source/mozilla-thunderbird/+bug/78435

Thanks, Alex.

Reproducible: Always

Steps to Reproduce:
1. Receive an email with a multi-extension attachment.. (foo.tar.gz for this example).
2. Open it up temporarily using an external program, the file is then saved to /tmp as foo.tar.gz 
3. Now close it down and open it again, the file is now known as foo.tar-1.gz in /tmp as a posed to foo.tar.gz. 
Actual Results:  
was named as foo.tar-1.gz

Expected Results:  
been named foo-1.tar.gz
->NEW on Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2pre) Gecko/20070107 Thunderbird/2.0b1 ID:2007010703, trunk too

Have to be pretty fast to open it though... If more then a sec or two, it will work as expected.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: unspecified → Trunk
Attached patch add suffix before first dot (obsolete) — Splinter Review
Attachment #273573 - Flags: review?(mscott)
Comment on attachment 273573 [details] [diff] [review]
add suffix before first dot

I'm not an xpcom module owner so my review here wouldn't mean much...
Attachment #273573 - Flags: review?(mscott)
Attachment #273573 - Flags: review?(benjamin)
Comment on attachment 273573 [details] [diff] [review]
add suffix before first dot

I'm not feeling especially good about this. What happens in the following cases?

1) filename starts with a dot, e.g. .mozconfig
2) filename has intermediary dots: e.g. my.documents.zip

Please re-request review if these cases have been adequately dealt with.
Attachment #273573 - Flags: review?(benjamin)
Attachment #273573 - Attachment is obsolete: true
Attached patch patch v2 (obsolete) — Splinter Review
For .mozconfig, the temporary file name will be 1.mozconfig, 2.mozconfig etc

For my.documents.tar, the temporary file name will be my1.docuemtns.tar my2.docuemtns.tar etc.
Attachment #274617 - Flags: review?(benjamin)
Comment on attachment 274617 [details] [diff] [review]
patch v2

I'd like a second person to agree to this... it seems a little scary for some reason I can't quite put my finger on.
Attachment #274617 - Flags: superreview?(cbiesinger)
Attachment #274617 - Flags: review?(benjamin)
Attachment #274617 - Flags: review+
Assignee: mscott → nobody
biesi, sr ping?
Whiteboard: [patchlove]
Attachment #274617 - Attachment is obsolete: true
Attachment #274617 - Flags: superreview?(cbiesinger)
Comment on attachment 274617 [details] [diff] [review]
patch v2

Actually, unfortunately, patch has bitrotted.

$ patch -p0 --dry-run < ~/Desktop/attachment-5.cgi.txt 
patching file mozilla/xpcom/io/nsLocalFileCommon.cpp
Hunk #1 FAILED at 91.
Hunk #2 FAILED at 108.
2 out of 2 hunks FAILED -- saving rejects to file mozilla/xpcom/io/nsLocalFileCommon.cpp.rej
Component: General → XPCOM
Product: Thunderbird → Core
QA Contact: general → xpcom
Whiteboard: [patchlove]
Still present in firefox 8.

A filename starting with a dot (.mozconfig) means the file is "hidden" in unix life (will not show by default).
So adding something before the dot will not make it hidden anymore.
But it's not the problem here and what's the current behavior?

my.documents.tar becoming my-1.documents.tar is not that bad.
or maybe we can make an exception for *.tar.{bz2, gz, ...}
This has been bugging me too for a while. All my .tar.gz attachments can only be opened once, then I need to manually remove them in /tmp. Maybe an exception for *.tar.[a-z0-9]{2,3} as was suggested before ? 
Or how about adding the numbered suffix to the first text string :
.mozconfig -> .mozconfig-1
mydocuments.tar.gz -> mydocuments-1.tar.gz
Only "weird cases" would be:
my.documents.zip -> my-1.documents.zip
my.documents.tar.gz -> my-1.documents.tar.gz

(something which would match the following regex, more or less) (?:^[.]?)([a-zA-Z0-9]+)(?:\.|$)
Will firefox-31.0a1.en-US.win32.installer.exe be renamed to firefox-31-1.0a1.en-US.win32.installer.exe? I'm not sure it is a good idea...
(In reply to Matthias Versen [:Matti] from comment #15)
bug 1097517, comment 1
bug: 857732, comment 15

This bug is reported on 2007
2014 is about to end


It's not not yet assigned to any one or No commitments made from the last 7 years
Really a shame to the Great Mozilla team...!!!
Flags: needinfo?(bugzilla)
What kind of information you are requesting from me ?
As you can see in this bug report it's difficult to fix this and I'm sure that a developers accepts a patch that works.
before you ask: I'm a contributor and only marked duplicate bug reports duplicates of the first report.
Flags: needinfo?(bugzilla)
Thanks for the info

There was the similar report earlier & Mozilla has fixed the bug on save option
But, the open with action was not fixed. when looked at the patch applied to save option, I don't think it need much work, lack of priority is matters.

In Firefox there is no option to save & open automatically (like chrome's always open this type of file option)which could be a alternate. So, every time I have to use save option & manually open from download panel. Since I am getting ~100 mails per day on .txt.gz it became headache to me

(In reply to Matthias Versen [:Matti] from comment #17)
> What kind of information you are requesting from me ?
> As you can see in this bug report it's difficult to fix this and I'm sure
> that a developers accepts a patch that works.
> before you ask: I'm a contributor and only marked duplicate bug reports
> duplicates of the first report.
Similar Bug on Save option:
bug: 231048

The Patch by Ted Mielczarek [:ted.mielczarek]
https://bugzilla.mozilla.org/attachment.cgi?id=185008&action=diff

@ Ted Mielczarek [:ted.mielczarek]
Can you confirm the Product & Component mentioned on this bug: 366325 ( attachment 8521214 [details] )
If it possible kindly provide a patch for this too
There is no patch / commitments from last 7 years
Flags: needinfo?(ted)
Comparison of Download Manager's Behavior on Save and Open actions
I haven't looked at any of this code in years, so I'm not a good person to do this.
Flags: needinfo?(ted)
What was the rational for changing the file name in the first place? What is wrong with presenting a overwrite warning/question to the user for equal file names?

Silently changing file names is not very nice in my opinion. At least there should be an option to disable this mechanism.
It's great see that this little bug isn't fixed since 11 years....!
Even it's not assigned to anyone.
The bug still exists in Firefox quantum (i.e v57)

May be it's time to say good bye to Firefox and look for some alternatives.

This bug is still a problem with latest firefox (70.0.1) on windows (32bit) and linux (amd64).

This is extremely annoying as it means opening a tar.gz file in (for example) archive manager on linux fails every time other than the first time you click it. This does not seem time limited, my /tmp/mozilla_user0 folder has mis-renamed files from yesterday.

Severity: normal → S3

The severity field for this bug is relatively low, S3. However, the bug has 5 duplicates.
:nika, could you consider increasing the bug severity?

For more information, please visit auto_nag documentation.

Flags: needinfo?(nika)

The last needinfo from me was triggered in error by recent activity on the bug. I'm clearing the needinfo since this is a very old bug and I don't know if it's still relevant.

Flags: needinfo?(nika)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: