From becc05b4f1c347a458401002de3c74738a0cacdb Mon Sep 17 00:00:00 2001 From: Jon Hart Date: Thu, 21 Dec 2017 06:57:33 -0800 Subject: [PATCH] Cleaner client_id handling --- lib/msf/core/auxiliary/mqtt.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/msf/core/auxiliary/mqtt.rb b/lib/msf/core/auxiliary/mqtt.rb index 98745904b8..9924ef1529 100644 --- a/lib/msf/core/auxiliary/mqtt.rb +++ b/lib/msf/core/auxiliary/mqtt.rb @@ -26,9 +26,10 @@ module Msf def setup fail_with(Failure::BadConfig, 'READ_TIMEOUT must be > 0') if read_timeout <= 0 + client_id_arg = datastore['CLIENT_ID'] - if client_id_arg - fail_with(Failure::BadConfig, 'CLIENT_ID must be a non-empty string') if client_id_arg.blank? + if client_id_arg && client_id_arg.blank? + fail_with(Failure::BadConfig, 'CLIENT_ID must be a non-empty string') end end