From 6f97e45b3597809eff677584b9079578dbbcd194 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Wed, 2 Aug 2017 06:18:02 -0500 Subject: [PATCH] enable Ruby 2.2 compat checks in Rubocop, correct multi/handler compat --- .rubocop.yml | 3 +++ modules/exploits/multi/handler.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 4459545656..00f2ecd15f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -8,6 +8,9 @@ # inherit_from: .rubocop_todo.yml +AllCops: + TargetRubyVersion: 2.2 + Metrics/ClassLength: Description: 'Most Metasploit modules are quite large. This is ok.' Enabled: true diff --git a/modules/exploits/multi/handler.rb b/modules/exploits/multi/handler.rb index b73e7435dc..0d528c7a77 100644 --- a/modules/exploits/multi/handler.rb +++ b/modules/exploits/multi/handler.rb @@ -57,7 +57,7 @@ class MetasploitModule < Msf::Exploit::Remote timeout = datastore['ListenerTimeout'].to_i loop do break if session_created? && datastore['ExitOnSession'] - break if timeout.positive? && (stime + timeout < Time.now.to_f) + break if timeout > 0 && (stime + timeout < Time.now.to_f) sleep(1) end end