Skip to content

Commit 1d53031

Browse files
authored
Merge pull request #1127 from onekey-sec/1101-report-file-sandboxing
fix(report): adapt landlock passthrough for report file
2 parents 90dd7fa + a8efa93 commit 1d53031

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

python/unblob/processing.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@ def prepare_report_file(config: ExtractionConfig, report_file: Optional[Path]) -
209209
"Report file exists and --force not specified", path=report_file
210210
)
211211
return False
212+
if not report_file.parent.exists():
213+
logger.error(
214+
"Trying to write report file to a non-existent directory", path=report_file
215+
)
216+
return False
212217
return True
213218

214219

python/unblob/sandbox.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ def __init__(
5858

5959
if report_file:
6060
self.passthrough += [
61-
AccessFS.read_write(report_file),
62-
AccessFS.make_reg(report_file.parent),
61+
AccessFS.read_write(report_file.parent),
6362
]
6463

6564
def run(self, callback: Callable[P, R], *args: P.args, **kwargs: P.kwargs) -> R:

0 commit comments

Comments
 (0)