Skip to content

Commit f124051

Browse files
committed
Fix a few bugs and PR comments
1 parent f114092 commit f124051

File tree

2 files changed

+8
-4
lines changed
  • lib/msf

2 files changed

+8
-4
lines changed

lib/msf/core/db_manager/loot.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,11 @@ def report_loot(opts)
9797
# @param opts [Hash] Hash containing the updated values. Key should match the attribute to update. Must contain :id of record to update.
9898
# @return [Mdm::Loot] The updated Mdm::Loot object.
9999
def update_loot(opts)
100-
# TODO: remove unneeded workspace from opts until it's not automatically added to remote requests
101-
opts.delete(:workspace)
100+
wspace = opts.delete(:workspace)
101+
if wspace.kind_of? String
102+
wspace = find_workspace(wspace)
103+
opts[:workspace] = wspace
104+
end
102105

103106
::ActiveRecord::Base.connection_pool.with_connection {
104107
id = opts.delete(:id)

lib/msf/ui/console/command_dispatcher/db.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ def cmd_loot(*args)
11451145
print_error("Can't make loot with no info")
11461146
return
11471147
end
1148-
when '-t'
1148+
when '-t', '--type'
11491149
typelist = args.shift
11501150
if(!typelist)
11511151
print_error("Invalid type list")
@@ -1211,6 +1211,8 @@ def cmd_loot(*args)
12111211
loots = loots + framework.db.loots(framework.db.workspace, {:search_term => search_term})
12121212
else
12131213
each_host_range_chunk(host_ranges) do |host_search|
1214+
break if !host_search.nil? && host_search.empty?
1215+
12141216
loots = loots + framework.db.loots(framework.db.workspace, { :hosts => { :address => host_search }, :search_term => search_term })
12151217
end
12161218
end
@@ -1222,7 +1224,6 @@ def cmd_loot(*args)
12221224
if mode == :update
12231225
begin
12241226
loot.info = info if info
1225-
loot.filename = filename if filename
12261227
if types.size > 1
12271228
print_error "May only pass 1 type when performing an update."
12281229
next

0 commit comments

Comments
 (0)