aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/sandbox.rb
diff options
context:
space:
mode:
authorXu Cheng2015-04-23 12:33:54 +0800
committerXu Cheng2015-04-23 12:33:54 +0800
commit35855e1fadd6b6a051fb78df19e73680dc261868 (patch)
treef2d77e30e419b62aafaa04442e61295d57be7888 /Library/Homebrew/sandbox.rb
parent8413e068a263116654c6b7e39e25c91235cc1189 (diff)
downloadhomebrew-35855e1fadd6b6a051fb78df19e73680dc261868.tar.bz2
sandbox: add deny_write_homebrew_library method
Diffstat (limited to 'Library/Homebrew/sandbox.rb')
-rw-r--r--Library/Homebrew/sandbox.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/Library/Homebrew/sandbox.rb b/Library/Homebrew/sandbox.rb
index 9ad920926..37d579da5 100644
--- a/Library/Homebrew/sandbox.rb
+++ b/Library/Homebrew/sandbox.rb
@@ -53,6 +53,12 @@ class Sandbox
allow_write_path HOMEBREW_LOGS/formula.name
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)
begin
seatbelt = Tempfile.new(["homebrew", ".sb"], HOMEBREW_TEMP)