Skip to content

Commit 8bd2a69

Browse files
author
Brent Cook
committed
simplify and fix rpc_get_note
1 parent 52b9fc8 commit 8bd2a69

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/msf/core/rpc/v10/rpc_db.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,10 @@ def init_db_opts_workspace(xopts)
107107
def get_notes(xopts)
108108
::ActiveRecord::Base.connection_pool.with_connection {
109109
opts, wspace = init_db_opts_workspace(xopts)
110-
111-
ret = {}
112-
ret[:note] = []
110+
notes = []
113111

114112
host = self.framework.db.get_host(opts)
115-
116-
return ret if not host
117-
notes = []
113+
return notes if not host
118114

119115
if opts[:proto] && opts[:port]
120116
services = []
@@ -833,6 +829,9 @@ def rpc_get_service(xopts)
833829
# @example Here's how you would use this from the client:
834830
# rpc.call('db.get_note', {:proto => 'tcp', :port => 80})
835831
def rpc_get_note(xopts)
832+
ret = {}
833+
ret[:note] = []
834+
836835
notes = get_notes(xopts)
837836

838837
notes.each do |n|

0 commit comments

Comments
 (0)