move sudo -k to formula_installer
sudo -k cannot be used inside sandbox Closes Homebrew/homebrew#43345. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
a5aba7f7d8
commit
ddb630b01c
@ -168,9 +168,6 @@ begin
|
||||
error_pipe = UNIXSocket.open(ENV["HOMEBREW_ERROR_PIPE"], &:recv_io)
|
||||
error_pipe.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
|
||||
|
||||
# Invalidate the current sudo timestamp in case a build script calls sudo
|
||||
system "/usr/bin/sudo", "-k"
|
||||
|
||||
trap("INT", old_trap)
|
||||
|
||||
formula = ARGV.formulae.first
|
||||
|
||||
@ -547,6 +547,9 @@ class FormulaInstaller
|
||||
end
|
||||
|
||||
Utils.safe_fork do
|
||||
# Invalidate the current sudo timestamp in case a build script calls sudo
|
||||
system "/usr/bin/sudo", "-k"
|
||||
|
||||
if Sandbox.available? && ARGV.sandbox? && !Sandbox.auto_disable?
|
||||
sandbox = Sandbox.new
|
||||
formula.logs.mkpath
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user