From 1a63e9387539449bcd10e77eeb5b7a890213b8c7 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Tue, 15 May 2012 01:56:33 -0400 Subject: [PATCH] `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 Homebrew/homebrew#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. --- Library/Homebrew/build.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index 319f58df91..ab1a44e6e7 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']