Skip to content
Snippets Groups Projects
Commit e4db0adf authored by Dominyk Tiller's avatar Dominyk Tiller Committed by Mike McQuaid
Browse files

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: default avatarMike McQuaid <mike@mikemcquaid.com>
parent a0540058
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment