qubes: Mark Dangerzone messages as trusted

Mark the messages that Dangerzone creates once a conversion step
finishes as trusted, since they do not contain any string not controlled
by us.
This commit is contained in:
Alex Pyrgiotis 2023-07-28 18:55:22 +03:00
parent 72536a05ac
commit 6c374d8a7e
No known key found for this signature in database
GPG key ID: B6C15EBA0357C9AA

View file

@ -120,11 +120,11 @@ class Qubes(IsolationProvider):
percentage += percentage_per_page
text = f"Converting page {page}/{n_pages} to pixels"
self.print_progress(document, False, text, percentage)
self.print_progress_trusted(document, False, text, percentage)
# TODO handle leftover code input
text = "Converted document to pixels"
self.print_progress(document, False, text, percentage)
self.print_progress_trusted(document, False, text, percentage)
# FIXME pass OCR stuff properly (see #455)
old_environ = dict(os.environ)
@ -133,13 +133,13 @@ class Qubes(IsolationProvider):
os.environ["OCR_LANGUAGE"] = ocr_lang
def print_progress_wrapper(error: bool, text: str, percentage: float) -> None:
self.print_progress(document, error, text, percentage)
self.print_progress_trusted(document, error, text, percentage)
asyncio.run(PixelsToPDF(progress_callback=print_progress_wrapper).convert())
percentage = 100.0
text = "Safe PDF created"
self.print_progress(document, False, text, percentage)
self.print_progress_trusted(document, False, text, percentage)
# FIXME remove once the OCR args are no longer passed with env vars
os.environ.clear()