Skip to content
Snippets Groups Projects
Commit ddb630b0 authored by Xu Cheng's avatar Xu Cheng
Browse files

move sudo -k to formula_installer


sudo -k cannot be used inside sandbox

Closes Homebrew/homebrew#43345.

Signed-off-by: default avatarXu Cheng <xucheng@me.com>
parent a5aba7f7
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment