postinstall: don't allow writes to prefix itself.
Only the top-level directories inside it. We don't want formulae writing random junk in e.g. `/usr/local` even in `postinstall`.
This commit is contained in:
parent
666463ca2b
commit
2b547583a3
@ -37,8 +37,10 @@ module Homebrew
|
|||||||
sandbox.allow_write_log(formula)
|
sandbox.allow_write_log(formula)
|
||||||
sandbox.allow_write_xcode
|
sandbox.allow_write_xcode
|
||||||
sandbox.deny_write_homebrew_repository
|
sandbox.deny_write_homebrew_repository
|
||||||
sandbox.allow_write_path HOMEBREW_PREFIX
|
|
||||||
sandbox.allow_write_cellar(formula)
|
sandbox.allow_write_cellar(formula)
|
||||||
|
Keg::TOP_LEVEL_DIRECTORIES.each do |dir|
|
||||||
|
sandbox.allow_write_path "#{HOMEBREW_PREFIX}/#{dir}"
|
||||||
|
end
|
||||||
sandbox.exec(*args)
|
sandbox.exec(*args)
|
||||||
else
|
else
|
||||||
exec(*args)
|
exec(*args)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user