aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2016-09-23 11:12:08 +0100
committerGitHub2016-09-23 11:12:08 +0100
commit597a92af446a357c9d7d69dc57c4570c0fe06d85 (patch)
tree139a0fd40a41ddf633574e196333af936b47b3f6 /Library
parent9001855d64c4f069a0983cf0b82815766fd9c035 (diff)
parent536c48e804407a99c9fe750ca31cd42c7c1fd55a (diff)
downloadbrew-597a92af446a357c9d7d69dc57c4570c0fe06d85.tar.bz2
Merge pull request #1101 from MikeMcQuaid/sandbox-repository
sandbox: tweak HOMEBREW_REPOSITORY handling.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/postinstall.rb2
-rw-r--r--Library/Homebrew/sandbox.rb10
2 files changed, 8 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/postinstall.rb b/Library/Homebrew/cmd/postinstall.rb
index 71b71b3f5..e0bd8e31b 100644
--- a/Library/Homebrew/cmd/postinstall.rb
+++ b/Library/Homebrew/cmd/postinstall.rb
@@ -36,7 +36,7 @@ module Homebrew
sandbox.allow_write_cellar(formula)
sandbox.allow_write_xcode
sandbox.allow_write_path HOMEBREW_PREFIX
- sandbox.deny_write_homebrew_library
+ sandbox.deny_write_homebrew_repository
sandbox.exec(*args)
else
exec(*args)
diff --git a/Library/Homebrew/sandbox.rb b/Library/Homebrew/sandbox.rb
index a7fc99d4a..4d0709cb4 100644
--- a/Library/Homebrew/sandbox.rb
+++ b/Library/Homebrew/sandbox.rb
@@ -84,10 +84,14 @@ class Sandbox
allow_write_path formula.logs
end
- def deny_write_homebrew_library
- deny_write_path HOMEBREW_LIBRARY
- deny_write_path HOMEBREW_REPOSITORY/".git"
+ def deny_write_homebrew_repository
deny_write HOMEBREW_BREW_FILE
+ if HOMEBREW_PREFIX.to_s != HOMEBREW_REPOSITORY.to_s
+ deny_write_path HOMEBREW_REPOSITORY
+ else
+ deny_write_path HOMEBREW_LIBRARY
+ deny_write_path HOMEBREW_REPOSITORY/".git"
+ end
end
def exec(*args)