Bug #7678

Tails Installer crashes on upgrade if cruft files with same name are present on both sides

Added by sajolida 2014-07-28 16:08:49 . Updated 2015-02-24 22:50:25 .

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Installation
Target version:
Start date:
2014-07-28
Due date:
% Done:

100%

Feature Branch:
liveusb-creator:bugfix/7678-Tails-Installer-crashes-on-upgrade
Type of work:
Code
Blueprint:

Starter:
1
Affected tool:
Installer
Deliverable for:

Description

On upgrade, if both the source and destination USB sticks contain files with the same name, that are not part of what’s normally on a Tails USB stick, then Tails Installer crashes with:

ERROR:liveusb.creator:[Errno 17] File exists: '/media/Tails/$filename Information'

This is because on upgrade, Tails Installer first removes all expected files (liveos_toplevel_files) from the destination, and then extract (when upgrading from ISO) or copies (when “clone and upgrade”) all files from the source device to the destination one.

We could workaround this by deleting all files on the destination, when a file called the same name is on the source too. But this might lead to the personal data of the user, which our Installer has always been very careful about: it may not be that clear to users that they should not store any personal files on the system partition.

But, some filenames might clearly not be personal data and could then be treated as a special case, if they were created automatically by some operating system for example, then we could:

* either by unconditionally removing it from the destination before copying files;
* or by skipping it when copying files.

A better approach, that would avoid the need to list all these special cases, could be to copy only liveos_toplevel_files from the source on “clone and upgrade”. Given the files with these names were removed already from the destination device, no conflict should arise :)

(Long term, this calls for a MANIFEST file in the ISO filesystem, that would avoid having to encode this information in the Tails Installer source code, but oh well, this can wait.)


Subtasks


Related issues

Related to Tails - Bug #6783: Test whether Windows installation method creates unexpected files Resolved 2014-02-26

History

#1 Updated by intrigeri 2014-07-28 20:57:02

  • Subject changed from Tails Installer crashes if identical filenames are present on both sides to Tails Installer crashes on upgrade if cruft files with same name are present on both sides
  • Description updated
  • Type of work changed from Research to Code
  • Starter changed from No to Yes

#2 Updated by intrigeri 2014-07-28 22:19:09

  • related to Bug #6783: Test whether Windows installation method creates unexpected files added

#3 Updated by intrigeri 2014-07-28 22:24:09

  • Assignee set to kurono
  • Priority changed from Low to Normal

After reading Bug #6783 again, I think that this bug is triggered when doing “clone and upgrade” from one device created with the Universal USB Installer, to another one that was also created with the UUI. Since nothing in our documentation says that it’s not a supported use case, I’m bumping the priority of this ticket: something is broken even if the user doesn’t do anything crazy and unsupported.

kurono, want to give it a try?

#4 Updated by kurono 2014-07-29 07:04:23

ok I’ll take it.

#5 Updated by sajolida 2014-08-07 17:49:04

For example, we received a bug report by someone having a “System Volume Information” folder on both USB stick. According to support.microsoft.com, “the System Volume Information folder is a hidden system folder that the System Restore tool uses to store its information and restore points”. So this should be treated as a metadata folder, not containing any personal data.

https://support.microsoft.com/kb/309531

#6 Updated by kurono 2014-11-27 20:06:44

  • Assignee deleted (kurono)
  • Target version set to Tails_1.2.1
  • QA Check set to Ready for QA
  • Feature Branch set to bugfix/7678-Tails-Installer-crashes-on-upgrade

#7 Updated by intrigeri 2014-11-27 20:56:08

  • Target version changed from Tails_1.2.1 to Tails_1.3

Too late for getting this tested enough in time for 1.2.1 IMO.

#8 Updated by anonym 2014-12-01 16:53:38

  • Target version changed from Tails_1.3 to Tails_1.2.2

It should go into the next release, though.

#9 Updated by intrigeri 2014-12-03 21:44:54

  • Status changed from Confirmed to In Progress
  • % Done changed from 0 to 50

#10 Updated by anonym 2014-12-12 16:41:56

  • Target version changed from Tails_1.2.2 to Tails_1.2.3

#11 Updated by alant 2014-12-23 18:04:02

  • Assignee set to kurono
  • QA Check changed from Ready for QA to Dev Needed
  • Feature Branch changed from bugfix/7678-Tails-Installer-crashes-on-upgrade to liveusb-creator:bugfix/7678-Tails-Installer-crashes-on-upgrade

Thanks for the patch which I imported into liveusb-creator repository in the feature branch.

I confirm the patch fixes the issue.

A tiny comment though: as toplevels is only used once, so why not to write one less line:

-        toplevels = config['liveos_toplevel_files']
-        for f in toplevels:
+        for f in config['liveos_toplevel_files']:

#12 Updated by intrigeri 2014-12-24 12:14:19

  • % Done changed from 50 to 60

#13 Updated by BitingBird 2015-01-04 19:00:49

  • Affected tool set to Installer

#14 Updated by kurono 2015-01-07 17:55:45

  • Assignee deleted (kurono)
  • QA Check changed from Dev Needed to Ready for QA

I did the small fix.

#15 Updated by intrigeri 2015-01-13 12:52:31

  • Assignee set to anonym

#16 Updated by anonym 2015-01-13 14:11:50

  • Assignee changed from anonym to intrigeri

Delegating to intrigeri.

#17 Updated by intrigeri 2015-01-13 16:16:22

  • Assignee changed from intrigeri to kurono
  • Target version changed from Tails_1.2.3 to Tails_1.3
  • % Done changed from 60 to 70
  • QA Check changed from Ready for QA to Dev Needed

Tails Installer from current kurono branch fails with global name 'config' is not defined. I guess that’s because from liveusb.config import config (which was initially in that branch) was removed, for some strange reason, when that branch’s history was rewritten. Seems easy to fix, but we’re already late for the release, so postponing to 1.3.

In the future, please do test the code you’re proposing for merging. Thanks in advance :)

#18 Updated by kurono 2015-01-13 21:56:07

  • Assignee deleted (kurono)
  • QA Check changed from Dev Needed to Ready for QA

Fix done.

#19 Updated by intrigeri 2015-01-14 19:52:52

  • Status changed from In Progress to Fix committed
  • % Done changed from 70 to 100
  • QA Check changed from Ready for QA to Pass

Thanks! Reviewed, tested, works for me. Merged into Tails Installer master branch => will be in Tails 1.3. Not bothered building and uploading a .deb, though.

#20 Updated by BitingBird 2015-02-24 22:50:25

  • Status changed from Fix committed to Resolved