mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Remove extraneous log sanitization
Remove an extra call to `replace_control_chars()`, as well as an unnecessary method.
This commit is contained in:
parent
0b45360384
commit
37bf9badf4
1 changed files with 5 additions and 10 deletions
|
@ -146,10 +146,13 @@ class IsolationProvider(ABC):
|
|||
|
||||
if getattr(sys, "dangerzone_dev", False):
|
||||
assert p.stderr
|
||||
untrusted_log = read_debug_text(p.stderr, MAX_CONVERSION_LOG_CHARS)
|
||||
debug_log = read_debug_text(p.stderr, MAX_CONVERSION_LOG_CHARS)
|
||||
p.stderr.close()
|
||||
log.info(
|
||||
f"Conversion output (doc to pixels)\n{self.sanitize_conversion_str(untrusted_log)}"
|
||||
"Conversion output (doc to pixels)\n"
|
||||
f"{DOC_TO_PIXELS_LOG_START}\n"
|
||||
f"{debug_log}" # no need for an extra newline here
|
||||
f"{DOC_TO_PIXELS_LOG_END}"
|
||||
)
|
||||
|
||||
@abstractmethod
|
||||
|
@ -196,14 +199,6 @@ class IsolationProvider(ABC):
|
|||
def get_max_parallel_conversions(self) -> int:
|
||||
pass
|
||||
|
||||
def sanitize_conversion_str(self, untrusted_conversion_str: str) -> str:
|
||||
conversion_string = replace_control_chars(untrusted_conversion_str)
|
||||
|
||||
# Add armor (gpg-style)
|
||||
armor_start = f"{DOC_TO_PIXELS_LOG_START}\n"
|
||||
armor_end = DOC_TO_PIXELS_LOG_END
|
||||
return armor_start + conversion_string + armor_end
|
||||
|
||||
@abstractmethod
|
||||
def start_doc_to_pixels_proc(self, document: Document) -> subprocess.Popen:
|
||||
pass
|
||||
|
|
Loading…
Reference in a new issue