Skip to content

Commit 5f8c14c

Browse files
committed
Fix check for TrueClass, plus other small changes
1 parent 6f4259f commit 5f8c14c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def call(meth, *args)
7272
if res && [200, 401, 403, 500].include?(res.code)
7373
resp = MessagePack.unpack(res.body)
7474

75-
if resp && resp.kind_of?(::Hash) && resp['error']
75+
if resp && resp.kind_of?(::Hash) && resp['error'] == true
7676
raise Msf::RPC::ServerException.new(resp['error_code'] || res.code, resp['error_message'] || resp['error_string'], resp['error_class'], resp['error_backtrace'])
7777
end
7878

msfrpc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ opts = {
4141
}
4242

4343
# Parse command line arguments.
44-
arguments.parse(ARGV) do |opt, idx, val|
44+
arguments.parse(ARGV) { |opt, idx, val|
4545
case opt
4646
when "-a"
4747
opts['ServerHost'] = val
@@ -57,7 +57,7 @@ arguments.parse(ARGV) do |opt, idx, val|
5757
print("\nUsage: #{File.basename(__FILE__)} <options>\n" + arguments.usage)
5858
exit
5959
end
60-
end
60+
}
6161

6262

6363
unless opts['ServerHost']
@@ -87,7 +87,7 @@ rpc.login(opts['User'], opts['Pass'])
8787

8888
puts "[*] The 'rpc' object holds the RPC client interface"
8989
puts "[*] Use rpc.call('group.command') to make RPC calls"
90-
puts
90+
puts ''
9191

9292
while(ARGV.shift)
9393
end

plugins/msgrpc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def initialize(framework, opts)
6363

6464
# If the run in foreground flag is not specified, then go ahead and fire
6565
# it off in a worker thread.
66-
unless opts['RunInForeground']
66+
if (opts['RunInForeground'] != true)
6767
# Store a handle to the thread so we can kill it during
6868
# cleanup when we get unloaded.
6969
self.thread = Thread.new { run }

0 commit comments

Comments
 (0)