diff --git a/python/unblob/processing.py b/python/unblob/processing.py index 9511cfc7a3..5b08c6b46d 100644 --- a/python/unblob/processing.py +++ b/python/unblob/processing.py @@ -209,6 +209,11 @@ def prepare_report_file(config: ExtractionConfig, report_file: Optional[Path]) - "Report file exists and --force not specified", path=report_file ) return False + if not report_file.parent.exists(): + logger.error( + "Trying to write report file to a non-existent directory", path=report_file + ) + return False return True diff --git a/python/unblob/sandbox.py b/python/unblob/sandbox.py index 9536fe9584..ff9e90884c 100644 --- a/python/unblob/sandbox.py +++ b/python/unblob/sandbox.py @@ -58,8 +58,7 @@ def __init__( if report_file: self.passthrough += [ - AccessFS.read_write(report_file), - AccessFS.make_reg(report_file.parent), + AccessFS.read_write(report_file.parent), ] def run(self, callback: Callable[P, R], *args: P.args, **kwargs: P.kwargs) -> R: