Prevent payload creation with duplicate uuids
parent
7e6c3261b6
commit
35e767e2dd
|
@ -1,6 +1,12 @@
|
|||
module Msf::DBManager::Payload
|
||||
|
||||
def create_payload(opts)
|
||||
if opts[:uuid] && !opts[:uuid].to_s.empty?
|
||||
if Mdm::Payload.find_by(uuid: opts[:uuid])
|
||||
raise ArgumentError.new("A payload with this uuid already exists.") if opts[:ids].nil?
|
||||
end
|
||||
end
|
||||
|
||||
Mdm::Payload.create(opts)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue