From 6dd51ff399df505921336faba3170611991b1d96 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 19 Feb 2015 09:29:17 +0000 Subject: [PATCH] audit: check for setuid in caveats. --- Library/Homebrew/cmd/audit.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index b13a2ad9d8..3d5f6c440b 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -700,6 +700,14 @@ class FormulaAuditor end end + def audit_caveats + caveats = formula.caveats + + if caveats =~ /setuid/ + problem "Don't recommend setuid in the caveats, suggest sudo instead." + end + end + def audit_prefix_has_contents return unless formula.prefix.directory? @@ -748,6 +756,7 @@ class FormulaAuditor audit_options audit_patches audit_text + audit_caveats text.without_patch.split("\n").each_with_index { |line, lineno| audit_line(line, lineno+1) } audit_installed audit_prefix_has_contents