aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2012-05-15 01:56:33 -0400
committerMax Howell2012-05-15 01:56:33 -0400
commit76bab9095949cbae4fa547fdb9b71bf767420c24 (patch)
treeec5d3637e96fb09f9add3dc787d1e65e75f65d6d /Library
parent2d8d474d5a774421f228d7bad724b04966ceb36d (diff)
downloadhomebrew-76bab9095949cbae4fa547fdb9b71bf767420c24.tar.bz2
`sudo -k` before calling build scripts
Potentially build scripts would call sudo, if so we don't want that to automatically succeed just because the time-period in which sudo works is still active after a previous incantation. Closes #10629. In fact I don't see how this can have been the problem, but if this isn't the problem then I don't see what else can be the problem.
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Homebrew/build.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb
index 319f58df9..ab1a44e6e 100755
--- a/Library/Homebrew/build.rb
+++ b/Library/Homebrew/build.rb
@@ -27,6 +27,11 @@ at_exit do
# dev tools into /usr/bin as a default
ENV.prepend 'PATH', MacOS.dev_tools_path, ':' unless ORIGINAL_PATHS.include? MacOS.dev_tools_path
+ # Force any future invocations of sudo to require the user's password to be
+ # re-entered. This is in-case any build script call sudo. Certainly this is
+ # can be inconvenient for the user. But we need to be safe.
+ system "/usr/bin/sudo -k"
+
install(Formula.factory($0))
rescue Exception => e
if ENV['HOMEBREW_ERROR_PIPE']