wrong permissions on /tmp files makes it impossible to directly view with external viewer

Bug #254169 reported by Tormod Volden
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
firefox-3.0 (Ubuntu)
Confirmed
Undecided
Unassigned
xulrunner-1.9 (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Binary package hint: firefox-3.0

When I click on a link (on launchpad for instance) for a diff.gz file, I get an error dialog:

/tmp/xserver-xorg-video-ati_1:6.9.0+git20080802.1f3eee36-0ubuntu0tormod1_1:6.9.0+git20080802.1f3eee36-0ubuntu0tormod2.diff.gz could not be opened, because the associated helper application does not exist. Change the association in your preferences.

In the Download Manager it says "Failed" and double-clicking on it here (or Retry) just yields the same error dialog.

Looking at /tmp, the file in question has permission 0400. Changing it to 0600, I can double-click and open it in Download Manager again.

Revision history for this message
Tormod Volden (tormodvolden) wrote :
Revision history for this message
Tormod Volden (tormodvolden) wrote :

Clicking on the above link to my uploaded file in launchpad gives another result, probably because the server ships another MIME type. Now I get a question of opening with Firefox, which gives another error dialog, or with "less" which is useless because the less window probably disappears before I see it.

To see the original issue, see https://launchpad.net/~tormodvolden/+archive and click on any "Available diffs".

Revision history for this message
Tormod Volden (tormodvolden) wrote :

This is a major PITA when browsing such files. I remember that before these files would just open inside the Firefox window (automatically gunzipped), which was much more convenient.

Revision history for this message
Tormod Volden (tormodvolden) wrote :

Clicking on a link like http://ftp.de.debian.org/debian/pool/main/l/linux-wlan-ng/linux-wlan-ng_0.2.9+dfsg-1.diff.gz works better. It still doesn't open in the browser window, but the Opening dialog suggest Archive Manager which works fine. I think the difference between these links is the MIME type in the server response header.

Revision history for this message
Jani Uusitalo (uusijani) wrote :

I can confirm this with a freshly installed 8.04.1 + updates, when opening a .deb file. Steps to reproduce:

1. Go to http://virtualbox.org/wiki/Downloads, Binaries (all platforms), select Ubuntu 8.04 (x86) and agree to the PUEL to get the download link.
2. Click on the download link to get the download action dialog.
3. Choose the default (Open with GDebi).

What happens: Firefox says the file "could not be opened, because the associated helper application does not exist."
What I expected to happen: To have the downloaded .deb file open in GDebi.

Changed in firefox-3.0:
status: New → Confirmed
TJ (tj)
Changed in xulrunner-1.9:
assignee: nobody → intuitivenipple
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
TJ (tj) wrote :

This and another issue are intertwined, making it difficult to track down the source of the issues. (Bug #239952 firefox - the associated helper application does not exist).

This issue is caused by a change in the handling of file permissions for temporary downloaded files on all platforms except Mac in xulrunner. Fortunately there is a work-around in the form of the configuration setting:

browser.helperApps.deleteTempFileOnExit = false (boolean)

This can be added via Firefox's "about:config" page.

The code in question is in mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp in the method nsExternalAppHandler::OpenWithApplication() :

    nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
    if (!prefs || NS_FAILED(prefs->GetBoolPref(
        "browser.helperApps.deleteTempFileOnExit", &deleteTempFileOnExit))) {
      // No prefservice or no pref set; use default value
#if !defined(XP_MACOSX)
      // Mac users have been very verbal about temp files being deleted on
      // app exit - they don't like it - but we'll continue to do this on
      // other platforms for now.
      deleteTempFileOnExit = PR_TRUE;
#else
      deleteTempFileOnExit = PR_FALSE;
#endif
    }

    // make the tmp file readonly so users won't edit it and lose the changes
    // only if we're going to delete the file
    if (deleteTempFileOnExit)
      mFinalFileDestination->SetPermissions(0400);

TJ (tj)
Changed in xulrunner-1.9:
assignee: intuitivenipple → nobody
Revision history for this message
marco (schlickspringer) wrote :

Is this bug related to https://bugs.launchpad.net/firefox/+bug/239952 and will it ever get fixed ? The above workaround does not work on Lucid with Firefox 3.6.8.

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Yes, it's the same bug.

The bug is fixed in Firefox 4.0 by a patch which was committed to fix an unrelated problem. I've backported the changes for Firefox 3.6 and requested it to be landed upstream. If that doesn't happen, then we'll try to distro-patch it to make it work for Maverick.

Revision history for this message
Tormod Volden (tormodvolden) wrote :

For some reason (lp changes?) I can not reproduce with my own examples above any longer, but the http://ubuntuforums.org/showpost.php?p=8707510&postcount=6 link from the other bug shows the same problem. Thanks for the Firefox 4.0 hint, I am running it now and I guess there is no way back :) I'll mark this one a duplicate.

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.