From c7b0173688c7ef3684874c220a24b654b9ee36d6 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Wed, 4 Nov 2015 12:52:47 +0000 Subject: [PATCH] doctor: tweak tmp sticky bit check --- Library/Homebrew/cmd/doctor.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index eecec57884..1bf69b00f4 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -454,10 +454,18 @@ class Checks end def check_tmpdir_sticky_bit + # Repair Disk Permissions was removed(?) in El Capitan. + # https://support.apple.com/en-us/HT201560 + if MacOS.version < "10.11" + fix_message = "Please run \"Repair Disk Permissions\" in Disk Utility." + else + fix_message = "Please execute `sudo chmod +t #{HOMEBREW_TEMP}` in your Terminal" + end + 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. + #{fix_message} EOS end end