Skip to content

Commit

Permalink
Merge pull request #1127 from onekey-sec/1101-report-file-sandboxing
Browse files Browse the repository at this point in the history
fix(report): adapt landlock passthrough for report file
  • Loading branch information
vlaci authored Feb 11, 2025
2 parents 90dd7fa + a8efa93 commit 1d53031
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions python/unblob/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 1 addition & 2 deletions python/unblob/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1d53031

Please sign in to comment.