Remove unecessary directory check
This commit is contained in:
parent
ab46965d95
commit
ea364210f2
@ -37,14 +37,7 @@ class Sandbox
|
|||||||
def allow_write(path:, type: :literal)
|
def allow_write(path:, type: :literal)
|
||||||
add_rule allow: true, operation: "file-write*", filter: path_filter(path, type)
|
add_rule allow: true, operation: "file-write*", filter: path_filter(path, type)
|
||||||
add_rule allow: true, operation: "file-write-setugid", filter: path_filter(path, type)
|
add_rule allow: true, operation: "file-write-setugid", filter: path_filter(path, type)
|
||||||
|
add_rule allow: true, operation: "file-write-mode", filter: path_filter(path, type)
|
||||||
file_write_mode_path = if Pathname(path).directory?
|
|
||||||
"#{path}/*"
|
|
||||||
else
|
|
||||||
path
|
|
||||||
end
|
|
||||||
|
|
||||||
add_rule allow: true, operation: "file-write-mode", filter: path_filter(file_write_mode_path, type)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(path: T.any(String, Pathname), type: Symbol).void }
|
sig { params(path: T.any(String, Pathname), type: Symbol).void }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user