From b10d68f3f93cccf931e07421c9cea6101c959907 Mon Sep 17 00:00:00 2001 From: HD Moore Date: Mon, 3 May 2010 01:03:49 +0000 Subject: [PATCH] Fixes #1791. Apply patch from jduck to fix bad returns from within proc git-svn-id: file:///home/svn/framework3/trunk@9208 4d416f70-5f16-0410-b530-b9f4589650da --- lib/msf/core/db.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/msf/core/db.rb b/lib/msf/core/db.rb index 7deccc70d6..854fa51967 100644 --- a/lib/msf/core/db.rb +++ b/lib/msf/core/db.rb @@ -466,8 +466,8 @@ class DBManager host.save! end - ntype = opts.delete(:type) || opts.delete(:ntype) || return - data = opts[:data] || return + ntype = opts.delete(:type) || opts.delete(:ntype) || raise RuntimeError, "A note :type or :ntype is required" + data = opts[:data] || raise RuntimeError, "Note :data is required" method = nil args = [] note = nil @@ -830,7 +830,7 @@ class DBManager host = get_host(:workspace => wspace, :host => addr) end - ltype = opts.delete(:type) || opts.delete(:ltype) || return + ltype = opts.delete(:type) || opts.delete(:ltype) || raise RuntimeError, "A loot :type or :ltype is required" ctype = opts.delete(:ctype) || opts.delete(:content_type) || 'text/plain' name = opts.delete(:name) info = opts.delete(:info) @@ -1608,7 +1608,7 @@ class DBManager addr = h["addrs"]["ipv6"] else # Can't report it if it doesn't have an IP - return + raise RuntimeError, "At least one IPv4 or IPv6 address is required" end data[:host] = addr if (h["addrs"].has_key?("mac"))