aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorDominyk Tiller2015-05-14 00:48:49 +0100
committerMike McQuaid2015-05-14 21:24:49 +0100
commite4db0adf547d47b71c3feeb98daeedf8acb67274 (patch)
tree673f7985dde00c075232c18f78b98ca89a5c9117 /Library
parenta0540058833dcf89d4bba3734828393d8ac4164d (diff)
downloadbrew-e4db0adf547d47b71c3feeb98daeedf8acb67274.tar.bz2
doctor: add homebrew_temp sticky bit check
Adds a small check to the Doctor command to ensure HOMEBREW_TEMP has a sticky bit set. This has become a significant issue lately. Closes Homebrew/homebrew#39735 Original issue: Homebrew/homebrew#39170 Closes Homebrew/homebrew#39739. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/doctor.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 4d253e639..fdfcacb43 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -419,6 +419,16 @@ def check_access_usr_local
end
end
+def check_tmpdir_sticky_bit
+ world_writable = HOMEBREW_TEMP.stat.mode & 0777 == 0777
+ if world_writable && !HOMEBREW_TEMP.sticky? then <<-EOS.undent
+ #{HOMEBREW_TEMP} is world-writable but does not have the sticky bit set.
+ Please run "Repair Disk Permissions" in Disk Utility.
+ EOS
+ end
+end
+
+
(Keg::TOP_LEVEL_DIRECTORIES + ["lib/pkgconfig"]).each do |d|
define_method("check_access_#{d.sub("/", "_")}") do
dir = HOMEBREW_PREFIX.join(d)