From 12f0448bb43938db713521e35fdfd4c5f37cf653 Mon Sep 17 00:00:00 2001 From: James Lee Date: Wed, 29 May 2013 16:12:31 -0500 Subject: [PATCH] Use a LIKE test instead of equality Fixes the ability to search for CVE (as well as other reference types) with a non-exact match [SeeRM #7989] --- lib/msf/core/db_manager.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/msf/core/db_manager.rb b/lib/msf/core/db_manager.rb index a618613a64..4f251614d4 100644 --- a/lib/msf/core/db_manager.rb +++ b/lib/msf/core/db_manager.rb @@ -666,11 +666,11 @@ class DBManager formatted_values = value_set.collect { |value| prefix = keyword.upcase - "#{prefix}-#{value}" + "#{prefix}-%#{value}%" } query = query.includes(:refs) - union_conditions << Mdm::Module::Ref.arel_table[:name].eq_any(formatted_values) + union_conditions << Mdm::Module::Ref.arel_table[:name].matches_any(formatted_values) end end