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

Bug #905355 reported by Benjamin Bach
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
LibreOffice
Invalid
Medium
libreoffice (Ubuntu)
Fix Released
Medium
Unassigned
Precise
Fix Released
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.

Revision history for this message
Benjamin Bach (benjaoming) wrote :
Revision history for this message
In , Björn Michaelsen (bjoern-michaelsen) 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.

Revision history for this message
In , Björn Michaelsen (bjoern-michaelsen) wrote :

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
Revision history for this message
In , Warrior-of-elyon (warrior-of-elyon) wrote :

Could you please provide a code pointer for this?

Revision history for this message
In , Björn Michaelsen (bjoern-michaelsen) wrote :

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)
Changed in libreoffice (Ubuntu):
importance: Undecided → High
tags: added: precise
Changed in libreoffice (Ubuntu Precise):
milestone: none → ubuntu-12.04-beta-2
Revision history for this message
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.

Revision history for this message
Christopher Forster (christopherforster) wrote :

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
Revision history for this message
In , Jordan Chin (retroneon) wrote :

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

Revision history for this message
In , Jordan Chin (retroneon) wrote :

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)
Changed in libreoffice (Ubuntu Precise):
milestone: ubuntu-12.04-beta-2 → ubuntu-12.04
importance: High → Medium
Revision history for this message
Björn Michaelsen (bjoern-michaelsen) wrote :

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?

Revision history for this message
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?)

Revision history for this message
In , Libreoffice-bugs (libreoffice-bugs) wrote :

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

Revision history for this message
In , E-andrzej (e-andrzej) wrote :

The bug is fixed

Revision history for this message
In , E-andrzej (e-andrzej) wrote :

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

Revision history for this message
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
Revision history for this message
In , Libreoffice-bugs (libreoffice-bugs) wrote :

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.

Revision history for this message
In , Libreoffice-bugs (libreoffice-bugs) wrote :

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

Revision history for this message
In , Libreoffice-bugs (libreoffice-bugs) wrote :

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.

Revision history for this message
In , Libreoffice-bugs (libreoffice-bugs) wrote :

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

Revision history for this message
In , Sergey Fukanchik (fuxx) wrote :

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

Revision history for this message
In , Reisi007 (reisi007) wrote :

Deleted "Easyhack" from summary.

Revision history for this message
In , Libreoffice-bugs (libreoffice-bugs) wrote :

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.

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

@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?

Revision history for this message
In , Björn Michaelsen (bjoern-michaelsen) wrote :

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
Revision history for this message
In , E-andrzej (e-andrzej) wrote :

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

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.