Land #4319, @wchen-r7's fix for #4307

bug/bundler_fix
Jon Hart 2014-12-05 12:08:39 -08:00
commit da92e4705c
No known key found for this signature in database
GPG Key ID: 2FA9F0A3AFA8E9D3
3 changed files with 14 additions and 3 deletions

View File

@ -55,7 +55,7 @@ module Auxiliary
# Verify the ACTION
if (mod.actions.length > 0 and not mod.action)
raise MissingActionError, "You must specify a valid Action", caller
raise MissingActionError, "Please use: #{mod.actions.collect {|e| e.name} * ", "}"
end
# Verify the options

View File

@ -210,9 +210,15 @@ end
###
class MissingActionError < ArgumentError
include AuxiliaryError
attr_accessor :reason
def initialize(reason='')
self.reason = reason
super
end
def to_s
"A valid action has not been selected."
"Invalid action: #{reason}"
end
end

View File

@ -19,7 +19,12 @@ class Msf::Post < Msf::Module
include Msf::PostMixin
def setup; end
def setup
m = replicant
if m.actions.length > 0 && !m.action
raise Msf::MissingActionError, "Please use: #{m.actions.collect {|e| e.name} * ", "}"
end
end
def type
Msf::MODULE_POST