Land #5993, handle ADSI exceptions nicely

bug/bundler_fix
Brent Cook 2015-09-23 22:56:44 -05:00
commit 9519eef55d
No known key found for this signature in database
GPG Key ID: 1FFAA0B24B708F96
3 changed files with 15 additions and 3 deletions

View File

@ -51,7 +51,7 @@ class Metasploit3 < Msf::Post
begin
q = query(search_filter, max_search, FIELDS)
rescue RuntimeError => e
rescue ::RuntimeError, ::Rex::Post::Meterpreter::RequestError => e
print_error(e.message)
return
end

View File

@ -39,7 +39,13 @@ class Metasploit3 < Msf::Post
fields = datastore['FIELDS'].gsub(/\s+/, "").split(',')
search_filter = datastore['FILTER']
max_search = datastore['MAX_SEARCH']
begin
q = query(search_filter, max_search, fields)
rescue ::RuntimeError, ::Rex::Post::Meterpreter::RequestError => e
print_error(e.message)
return
end
if q.nil? || q[:results].empty?
print_status('No results found...')

View File

@ -60,7 +60,13 @@ class Metasploit3 < Msf::Post
fields = datastore['FIELDS'].gsub(/\s+/,"").split(',')
search_filter = datastore['FILTER']
max_search = datastore['MAX_SEARCH']
begin
q = query(search_filter, max_search, fields)
rescue ::RuntimeError, ::Rex::Post::Meterpreter::RequestError => e
print_error(e.message)
return
end
return if q.nil? or q[:results].empty?