temporary filenames should handle multiple extensions (.tar.gz)

Bug #78435 reported by Manuel López-Ibáñez
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mozilla Thunderbird
Confirmed
Unknown
thunderbird (Ubuntu)
Triaged
Low
Mozilla Bugs

Bug Description

Binary package hint: mozilla-thunderbird

When opening a file named foo.bar, the file is downloaded to /tmp. If the file is opened again in a short time, the file is again downloaded to /tmp but renamed foo-1.bar.

If the file has a double extension (for example, opening a foo.tar.gz file with ark), the file is renamed as foo.tar-1.gz and thus ark is not able to open it properly. It should be foo-1.tar.gz instead.

Revision history for this message
In , Alex Latchford (alex.latchford) wrote :

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

Revision history for this message
Alex Latchford (alex.latchford) wrote :

Howdy manu,

Thank you for the bug report, I can recreate this bug on my own install, therefore I have confirmed this report and sent the bug upstream to be dealt with as I feel it is not an Ubuntu specific problem, when changes are made upstream you will be notified by launchpad automatically.

Thanks again, Alex.

Changed in mozilla-thunderbird:
assignee: nobody → mozillateam
status: Unconfirmed → Confirmed
Revision history for this message
In , Mkmelin+mozilla (mkmelin+mozilla) wrote :

->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.

Changed in thunderbird:
status: Unknown → Confirmed
David Farning (dfarning)
Changed in mozilla-thunderbird:
assignee: mozillateam → mozilla-bugs
Changed in mozilla-thunderbird:
importance: Undecided → Low
Revision history for this message
In , Brian-lu (brian-lu) wrote :

Created attachment 273573
add suffix before first dot

Revision history for this message
In , Mscott-mozilla (mscott-mozilla) wrote :

Comment on attachment 273573
add suffix before first dot

I'm not an xpcom module owner so my review here wouldn't mean much...

Revision history for this message
In , Benjamin Smedberg (Mozilla) [:bs] (benjamin-smedbergs) wrote :

Comment on attachment 273573
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.

Revision history for this message
In , Brian-lu (brian-lu) wrote :

Created attachment 274617
patch v2

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.

Revision history for this message
In , Benjamin Smedberg (Mozilla) [:bs] (benjamin-smedbergs) wrote :

Comment on attachment 274617
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.

Revision history for this message
Micah Gersten (micahg) wrote :

Moving to thunderbird package.

affects: mozilla-thunderbird (Ubuntu) → thunderbird (Ubuntu)
Revision history for this message
In , Gary-rumblingedge (gary-rumblingedge) wrote :

biesi, sr ping?

Revision history for this message
In , Gary-rumblingedge (gary-rumblingedge) wrote :

Comment on attachment 274617
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

Revision history for this message
Micah Gersten (micahg) wrote :

Marking this Triaged as we have an upstream bug.

Changed in thunderbird (Ubuntu):
status: Confirmed → Triaged
Changed in thunderbird:
importance: Unknown → Medium
Revision history for this message
In , Alliz-gub (alliz-gub) wrote :

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, ...}

Revision history for this message
In , yannack (yannack) wrote :

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]+)(?:\.|$)

Revision history for this message
In , yfdyh000 (yfdyh000) wrote :

*** Bug 988320 has been marked as a duplicate of this bug. ***

Revision history for this message
In , yfdyh000 (yfdyh000) wrote :

*** Bug 810616 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Vyv03354 (vyv03354) wrote :

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...

Revision history for this message
In , Bugzilla-tf (bugzilla-tf) wrote :

*** Bug 1097517 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Bugzilla-tf (bugzilla-tf) wrote :

*** Bug 857732 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Er-thirumalai (er-thirumalai) wrote :

(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...!!!

Revision history for this message
In , Bugzilla-tf (bugzilla-tf) wrote :

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.

Revision history for this message
In , Er-thirumalai (er-thirumalai) wrote :

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.

Revision history for this message
In , Er-thirumalai (er-thirumalai) wrote :

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 )
If it possible kindly provide a patch for this too
There is no patch / commitments from last 7 years

Revision history for this message
In , Er-thirumalai (er-thirumalai) wrote :

Created attachment 8521348
Download Auto Renaming Comparison

Comparison of Download Manager's Behavior on Save and Open actions

Revision history for this message
In , Ted-f (ted-f) wrote :

I haven't looked at any of this code in years, so I'm not a good person to do this.

Revision history for this message
In , Cirdeiliviu (cirdeiliviu) wrote :

*** Bug 1127275 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Max Harmathy (max-harmathy) wrote :

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.

Revision history for this message
In , Er-thirumalai (er-thirumalai) wrote :

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.

Revision history for this message
In , Buildtherobots (buildtherobots) wrote :

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.

Changed in thunderbird:
importance: Medium → Unknown
Revision history for this message
In , Release-mgmt-account-bot (release-mgmt-account-bot) wrote :

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](https://wiki.mozilla.org/Release_Management/autonag#severity_underestimated.py).

Revision history for this message
In , Autonag-nomail-bot (autonag-nomail-bot) wrote :

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.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.