From af84e85174bb1d30f08ded103048092a06ed61b9 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Tue, 10 May 2016 04:21:31 -0500 Subject: [PATCH] fix exception suspending channels from meterpreter --- lib/rex/ui/interactive.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/rex/ui/interactive.rb b/lib/rex/ui/interactive.rb index 445da8dcf3..c8d69e48d6 100644 --- a/lib/rex/ui/interactive.rb +++ b/lib/rex/ui/interactive.rb @@ -253,11 +253,11 @@ protected # Installs a signal handler to monitor suspend signal notifications. # def handle_suspend - if (orig_suspend == nil) + if orig_suspend.nil? begin - self.orig_suspend = Signal.trap("TSTP") { - _suspend - } + self.orig_suspend = Signal.trap("TSTP") do + Thread.new { _suspend }.join + end rescue end end @@ -269,7 +269,7 @@ protected # def restore_suspend begin - if (orig_suspend) + if orig_suspend Signal.trap("TSTP", orig_suspend) else Signal.trap("TSTP", "DEFAULT")