Electrum wrapper's persistence check is wrong
Originally created by @anonym on #16821 (Redmine)
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.
Edited by anonym