Harden GUI timechain detection temp mount handling
Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/8a51f052-83d0-4079-8338-5cfdbb849aa2 Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
5fe2ecd56d
commit
38207e8b2f
@@ -8,6 +8,7 @@ import os
|
|||||||
import secrets
|
import secrets
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import tempfile
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@@ -816,10 +817,9 @@ class InstallerWindow(Adw.ApplicationWindow):
|
|||||||
if label != "BTCEcoandBackup":
|
if label != "BTCEcoandBackup":
|
||||||
return False
|
return False
|
||||||
|
|
||||||
check_mount = "/tmp/sovran-installer-data-check"
|
check_mount = tempfile.mkdtemp(prefix="sovran-installer-data-check-")
|
||||||
mounted = False
|
mounted = False
|
||||||
try:
|
try:
|
||||||
run(["sudo", "mkdir", "-p", check_mount])
|
|
||||||
run(["sudo", "mount", "-o", "ro", data_p1, check_mount])
|
run(["sudo", "mount", "-o", "ro", data_p1, check_mount])
|
||||||
mounted = True
|
mounted = True
|
||||||
|
|
||||||
@@ -834,7 +834,8 @@ class InstallerWindow(Adw.ApplicationWindow):
|
|||||||
)
|
)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
except Exception:
|
except Exception as e:
|
||||||
|
log(f"Timechain detection failed for {data_p1} at mount/check step ({check_mount}): {e}")
|
||||||
return False
|
return False
|
||||||
finally:
|
finally:
|
||||||
if mounted:
|
if mounted:
|
||||||
|
|||||||
Reference in New Issue
Block a user