[Upstream] Never let users save in /tmp by default

Bug #905355 reported by Benjamin Bach on 2011-12-16
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
LibreOffice
Invalid
Medium
libreoffice (Ubuntu)
Medium
Unassigned
Precise
Medium
Unassigned

Bug Description

When you download something and choose to open it in LibreOffice, it will be saved in /tmp. If you choose Save As, the default saving location will be in /tmp.

I just lost a partly written exam that way. I thought it was on my Desktop, but oh no, it was in /tmp and after rebooting it's now gone.

The suggestion is to NEVER let /tmp be the default folder in the Save dialog, and to ALWAYS warn the user if saving something there.

Benjamin Bach (benjaoming) wrote :

When you download something and choose to open it in LibreOffice, it will be saved in /tmp. If you choose Save As, the default saving location will be in /tmp.

I just lost a partly written exam that way. I thought it was on my Desktop, but oh no, it was in /tmp and after rebooting it's now gone.

The suggestion is to NEVER let /tmp be the default folder in the Save dialog, and to ALWAYS warn the user if saving something there.

EasyHackify

summary: - Never let users save in /tmp
+ [Upstream] Never let users save in /tmp by default
Changed in libreoffice (Ubuntu):
status: New → Confirmed
Changed in df-libreoffice:
importance: Unknown → Medium
status: Unknown → Confirmed

Could you please provide a code pointer for this?

The file picker code is in http://opengrok.libreoffice.org/xref/core/fpicker/ .
I would suggest to just check the initial path for being /tmp (on unix only) and falling back to $HOME in that case.

Bryce Harrington (bryce) on 2012-02-10
Changed in libreoffice (Ubuntu):
importance: Undecided → High
tags: added: precise
Changed in libreoffice (Ubuntu Precise):
milestone: none → ubuntu-12.04-beta-2
Bryce Harrington (bryce) wrote :

Confirmed; I can reproduce this bug.
Unfortunately... so has my wife, who learned the volatility of /tmp the hard way today. :-/

When user selects to save-as for a file that is in /tmp, it should default to save to ~/Documents instead.

Setting to high priority and targeting to precise since this usability issue can result in data loss.

See also: How does one change the PDF export default directory to $HOME? Question #162483 https://answers.launchpad.net/ubuntu/+source/libreoffice/+question/162483

tags: added: rls-mgr-p-tracking

I was not able to reproduce this bug. Has it already been fixed?

Oops, I did not fully understand the bug, but was able to reproduce it just now. I will take a look into this. There was a suggestion to warn the user if something is saved in the /tmp directory-- could I please get a code pointer as to how to do that?

Martin Pitt (pitti) on 2012-03-26
Changed in libreoffice (Ubuntu Precise):
milestone: ubuntu-12.04-beta-2 → ubuntu-12.04
importance: High → Medium

There is a proposed patch at:

http://nabble.documentfoundation.org/PATCH-Fix-for-Bug-43895-Never-let-users-save-in-tmp-by-default-td3837784.html

@bryce: Does the patch seem to do what you expect?

Bryce Harrington (bryce) wrote :

@Björn, yes conceptually that looks like it would address the problem of trying to edit an attachment from web mail. I believe in that case the /tmp/ file is read-only so the user is going to be prompted to re-save. This patch would suggest saving into the WORK directory.

(If WORK is just $HOME, might want to think about making it ~/Documents instead?)

Andrzej J. R. Hunt committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=dd2fe95cce75f1157bd1c75d286a0047b2e4175e

fdo#43895 lp#905355: Never let users save in /tmp by default

The bug is fixed

Sorry, that was incorrect. The bug is fixed under Unix, but still needs to be fixed for Windows which will involve changing one line (which I'll do once I'm finished with what I'm currently working on).

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libreoffice - 1:3.5.1-1ubuntu4

---------------
libreoffice (1:3.5.1-1ubuntu4) precise; urgency=low

  * version bump for bug 930217

libreoffice (1:3.5.1-1ubuntu3) precise-proposed; urgency=low

  * fix typo in control.in

libreoffice (1:3.5.1-1ubuntu2) precise-proposed; urgency=low

  * call fsync on write (LP: #817326)
  * add a few conflicts for defusing the old -common dpkg-trigger
    around interfering (LP: #916291)
  * its com.sun.star.sdb.RowSet, not sdbc neither sbd
  * never let users save in /tmp by default (LP: #905355)
 -- Bjoern Michaelsen <email address hidden> Fri, 30 Mar 2012 14:34:41 +0200

Changed in libreoffice (Ubuntu Precise):
status: Confirmed → Fix Released

Andrzej J. R. Hunt committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2890ca399dd23abd9b8b507d80f7242fce735278&g=libreoffice-3-5

fdo#43895 lp#905355: Never let users save in /tmp by default

It will be available in LibreOffice 3.5.3.

Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=dc2fe18e95731dcb7c9e2027f45fdaf265490592

fdo#43895 lp#905355: fix the fix so it doesn't crash

Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cac9cf690bf337a97ede781c38c5e7ddb3f37ca5&g=libreoffice-3-5

fdo#43895 lp#905355: fix the fix so it doesn't crash

It will be available in LibreOffice 3.5.3.

Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2d0ff6aa5d6951aaa00e2d6cf3878788b025983e

Related fdo#43895: Fixed shortcommings of FileDialogHelper_Impl::verifyPath

There is FileBase.getTempDirURL() which is better to use than hardcoded "/tmp" path.

Deleted "Easyhack" from summary.

Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=89f45b9fef98650cc3166d9337c96e58f0c57c4f&g=libreoffice-3-5

Related fdo#43895: Fixed shortcommings of FileDialogHelper_Impl::verifyPath

It will be available in LibreOffice 3.5.5.

@Sergey, agreed. we should not be hardcoding file://tmp when there are propoer functions to get the tempdir. Can you file a followup bug that can be marked as another EasyHack?

I think it _is_ a good idea to use a hardcoded path here. After all we are evading saving to /tmp, when another app (Firefox) put a file there. As tempdirs in configured in LibreOffice and Firefox might differ, you end up SOL in that case anyway. So keeping the current heuristic and just being caring about the "tmp" case should be the best we can do anyway.
resolving

Changed in df-libreoffice:
status: Confirmed → Invalid

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

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

Other bug subscribers

Remote bug watches

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