Bug #16821

Electrum wrapper's persistence check is wrong

Added by anonym 2019-06-18 16:10:39 . Updated 2019-06-18 16:33:48 .

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Persistence
Target version:
Start date:
Due date:
% Done:

100%

Feature Branch:
Type of work:
Code
Blueprint:

Starter:
Affected tool:
Electrum
Deliverable for:

Description

It looks like this:

def electrum_config_is_persistent():
    filesystem = sh.findmnt('--noheadings',
                            '--output', 'SOURCE',
                            '--target', CONF_DIR).stdout.decode().strip()
    return filesystem in sh.glob('/dev/mapper/TailsData_unlocked[/electrum]')

It does not make sense to do that glob expansion, which will try to match against these:

  • /dev/mapper/TailsData_unlocked/
  • /dev/mapper/TailsData_unlockede
  • /dev/mapper/TailsData_unlockedu
  • /dev/mapper/TailsData_unlockedm

of which none will match anything. Due to a bug in stretch’s python3-sh (version 1.11-1) sh.glob(e) returns e when there is no match, but it should clearly return the empty list, which it does in buster’s version (1.12.14-1.1). The correct check is filesystem == '/dev/mapper/TailsData_unlocked[/electrum]', and that the old check works in stretch is just a coincidence due to that bug.


Subtasks


History

#1 Updated by anonym 2019-06-18 16:14:30

> The correct check is filesystem == '/dev/mapper/TailsData_unlocked[/electrum]'

Clarification: the above is the expected findmnt output, which isn’t intended as something glob-expandable — the [...] suffix is just findmnt’s way to express bind mounts.

#2 Updated by anonym 2019-06-18 16:19:44

  • Target version changed from Tails_3.15 to Tails_4.0

We’ll ignore this situation for stretch since it works (by coincidence).

#3 Updated by anonym 2019-06-18 16:23:40

  • Status changed from Confirmed to Fix committed
  • % Done changed from 0 to 100

Applied in changeset commit:tails|ecff69548411b568e3a95f3fcfd425405ff9627a.

#4 Updated by intrigeri 2019-06-18 16:33:48

  • Status changed from Fix committed to Resolved