Bug 1161110

Summary: /usr/bin/firefox should not mess with TMPDIR
Product: [Fedora] Fedora Reporter: Michael Schwendt <bugs.michael>
Component: firefoxAssignee: Martin Stransky <stransky>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: gecko-bugs-nobody, mschmidt, piergiorgio.sartor, pierre-bugzilla, stransky, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: firefox-33.0-5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-10 08:28:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 867073, 956380    
Bug Blocks:    

Description Michael Schwendt 2014-11-06 12:01:02 UTC
This is about Fedora's Firefox changing the runtime environment for programs it can launch compared with the user's desktop environment. /usr/bin/firefox does:

  TMPDIR="${TMPDIR:-/var/tmp}"
  export TMPDIR

If it prefers /var/tmp over /tmp, it should do that internally only and not export a $TMPDIR that differs from the rest of the system.

Most (all?) API calls that return a temporary directory location default to /tmp if $TMPDIR is not set. Some still look at other environment variables, too, but that is beyond the scope of this ticket. Programs launched by Firefox would be affected by a $TMPDIR that is different than when starting the program normally.

At  https://fedorahosted.org/fesco/ticket/1365  a patch for Firefox has been demonstrated that would set /var/tmp internally.

Firefox should not override system defaults. It may default to /var/tmp (even with no option to override that), but $TMPDIR is not for /var/tmp but /tmp by default ( http://fedoraproject.org/wiki/Features/tmp-on-tmpfs ).

Comment 1 Martin Stransky 2014-11-06 15:37:52 UTC
Okay, will look at it.

Comment 2 Martin Stransky 2014-11-07 13:07:50 UTC
I'd rather see a patch which moves all temporary data to /tmp (the recent tmpfs) but only downloads are saved to /var/tmp.

Comment 3 Martin Stransky 2014-11-07 13:08:52 UTC
So we should remove the TMPDIR from the launch script but patch Firefox to save partial downloads to /var/tmp.

Comment 4 Martin Stransky 2014-11-10 08:28:17 UTC
Okay, let's remove the hack we use. The partial file is downloaded to /tmp while we wait for user interaction so the 1GB limit should be enough. Debian uses the same model. Added to firefox-33.0-5.

Comment 5 Ondrej Holy 2015-06-17 09:35:11 UTC
*** Bug 969658 has been marked as a duplicate of this bug. ***