sandbox: add deny_write_homebrew_library method
This commit is contained in:
parent
4db3e51c8e
commit
fbc47d86ad
@ -25,9 +25,7 @@ module Homebrew
|
|||||||
sandbox.allow_write_log(formula)
|
sandbox.allow_write_log(formula)
|
||||||
sandbox.allow_write_cellar(formula)
|
sandbox.allow_write_cellar(formula)
|
||||||
sandbox.allow_write_path HOMEBREW_PREFIX
|
sandbox.allow_write_path HOMEBREW_PREFIX
|
||||||
sandbox.deny_write_path HOMEBREW_LIBRARY
|
sandbox.deny_write_homebrew_library
|
||||||
sandbox.deny_write_path HOMEBREW_REPOSITORY/".git"
|
|
||||||
sandbox.deny_write HOMEBREW_BREW_FILE
|
|
||||||
sandbox.exec(*args)
|
sandbox.exec(*args)
|
||||||
else
|
else
|
||||||
exec(*args)
|
exec(*args)
|
||||||
|
|||||||
@ -53,6 +53,12 @@ class Sandbox
|
|||||||
allow_write_path HOMEBREW_LOGS/formula.name
|
allow_write_path HOMEBREW_LOGS/formula.name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def deny_write_homebrew_library
|
||||||
|
deny_write_path HOMEBREW_LIBRARY
|
||||||
|
deny_write_path HOMEBREW_REPOSITORY/".git"
|
||||||
|
deny_write HOMEBREW_BREW_FILE
|
||||||
|
end
|
||||||
|
|
||||||
def exec(*args)
|
def exec(*args)
|
||||||
begin
|
begin
|
||||||
seatbelt = Tempfile.new(["homebrew", ".sb"], HOMEBREW_TEMP)
|
seatbelt = Tempfile.new(["homebrew", ".sb"], HOMEBREW_TEMP)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user