aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMike McQuaid2015-02-19 09:29:17 +0000
committerMike McQuaid2015-02-19 09:29:17 +0000
commitc86df1583cf9001a8d82ce208c7416cf5680ce2a (patch)
treefdf18b72dd7754c3170cef86099089d58db9d99c /Library/Homebrew
parent7f6d05e12dc10e63e30afdc871173d488a96d182 (diff)
downloadhomebrew-c86df1583cf9001a8d82ce208c7416cf5680ce2a.tar.bz2
audit: check for setuid in caveats.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/audit.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index b13a2ad9d..3d5f6c440 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