I tracked down this bug.  The source of the problem is in src/file-
utils.c.  It looks like File Roller calls _g_path_get_temp_work_dir,
which searches the user's cache dir, user's home dir, and tmp, for a
place to put the temporary folder.  It searches in that order.  The
criteria for the search is available free space.  The location with the
most free space will be used.  If two locations have the same amount of
free space, the one searched first will be used.

The bug is that, at least on my system, /tmp and ~/.cache both have the
same amount of free space.  So ~/.cache gets used, since it's searched
first.

This searching algorithm is reasonable, as opposed to just always using
/tmp.  What if File Roller is run on a system where /tmp is limited, and
now the user can't extract an archive because /tmp keeps blowing up.  So
it makes sense to use whatever has the most available disk space.

I suggest fixing this by changing the search order.  The search order is
defined by:

static const char *try_folder[] = { "cache", "~", "tmp", NULL };

Let's change that to:

static const char *try_folder[] = { "tmp", "cache", "~", NULL };

It's a simple change, and for systems like mine, where /tmp is part of
the root filesystem, File Roller will use tmp since it should have the
same free space as cache.

A better solution may be a compile time option to force a particular
folder, or a run-time preference.  In both cases it will be up to the
distro to configure the appropriate compile option or default
preference, according to how their distro installs.

If someone lets me know: where to pull the latest File Roller source
code, and how to submit a patch, I can at least submit a patch tweaking
try_folder.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to file-roller in Ubuntu.
https://bugs.launchpad.net/bugs/245716

Title:
  file-roller puts temporary files in the home dir instead of /tmp

Status in File Roller:
  Confirmed
Status in file-roller package in Ubuntu:
  Triaged

Bug description:
  1) lsb_release -rd
  Description:  Ubuntu Vivid Vervet (development branch)
  Release:      15.04

  2) apt-cache policy file-roller
  file-roller:
    Installed: 3.12.2-0ubuntu1
    Candidate: 3.12.2-0ubuntu1
    Version table:
   *** 3.12.2-0ubuntu1 0
          500 http://us.archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages
          100 /var/lib/dpkg/status

  3) What is expected to happen is when one opens a tarball with file-
  roller, and without extracting the file, open it (ex. open PDF file
  with evince) the file-roller utilizes /tmp for this.

  4) What happens instead is file-roller utilizes a directory ~/.cache/.fr-* , 
where * is a changing folder name. If one logs out, or kills the file-roller 
process via:
  kill PID

  the temp files are left behind.

To manage notifications about this bug go to:
https://bugs.launchpad.net/file-roller/+bug/245716/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to