doctor: tweak tmp sticky bit check

This commit is contained in:
Dominyk Tiller 2015-11-04 12:52:47 +00:00
parent ffbb1828a2
commit c7b0173688

View File

@ -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