Skip to content

Commit ac9cf6d

Browse files
committed
fix(sandbox): add remove_dir/remove_file permissions to sandbox
When an extraction directory is empty, unblob will try to delete it. This can lead to PermissionError due to insufficient permissions within the sandbox. The same can happen when deleting files. We therefore allow unblob to delete directories and files from the extraction directory with the remove_dir and remove_file permissions.
1 parent 1eb720f commit ac9cf6d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

unblob/sandbox.py

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ def __init__(
4747
AccessFS.read_write("/dev/shm"), # noqa: S108
4848
# Extracted contents
4949
AccessFS.read_write(config.extract_root),
50+
AccessFS.remove_dir(config.extract_root),
51+
AccessFS.remove_file(config.extract_root),
5052
AccessFS.make_dir(config.extract_root.parent),
5153
AccessFS.read_write(log_path),
5254
*extra_passthrough,

0 commit comments

Comments
 (0)