aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula_cellar_checks.rb
diff options
context:
space:
mode:
authorTim D. Smith2014-10-19 23:58:29 -0700
committerTim D. Smith2014-10-20 09:45:43 -0700
commit7cfac1dd6e0fe609ba2717a02857ee22d79a4102 (patch)
tree8eadf508ed1bfab04cc04ecd916685c724af6666 /Library/Homebrew/formula_cellar_checks.rb
parentf4b496345ef1cd743acc85689cdb410cc5b2a8f6 (diff)
downloadhomebrew-7cfac1dd6e0fe609ba2717a02857ee22d79a4102.tar.bz2
add audit check for system OpenSSL linkage
Diffstat (limited to 'Library/Homebrew/formula_cellar_checks.rb')
-rw-r--r--Library/Homebrew/formula_cellar_checks.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb
index 939b55b1c..4b5e1cc9e 100644
--- a/Library/Homebrew/formula_cellar_checks.rb
+++ b/Library/Homebrew/formula_cellar_checks.rb
@@ -134,6 +134,23 @@ module FormulaCellarChecks
EOS
end
+ def check_openssl_links prefix
+ return unless prefix.directory?
+ keg = Keg.new(prefix)
+ system_openssl = keg.mach_o_files.select do |obj|
+ dlls = obj.dynamically_linked_libraries
+ dlls.any? { |dll| /\/usr\/lib\/lib(crypto|ssl).(\d\.)*dylib/.match dll }
+ end
+ return if system_openssl.empty?
+
+ <<-EOS.undent
+ object files were linked against system openssl
+ These object files were linked against the deprecated system OpenSSL.
+ Adding `depends_on "openssl"` to the formula may help.
+ #{system_openssl * "\n "}
+ EOS
+ end
+
def audit_installed
audit_check_output(check_manpages)
audit_check_output(check_infopages)
@@ -145,6 +162,7 @@ module FormulaCellarChecks
audit_check_output(check_generic_executables(f.sbin))
audit_check_output(check_shadowed_headers)
audit_check_output(check_easy_install_pth(f.lib))
+ audit_check_output(check_openssl_links(f.prefix))
end
private