Skip to content

Commit

Permalink
Land rapid7#7713, scriptkittie fix for SessionLogging
Browse files Browse the repository at this point in the history
lands a fix for loggers not handling a nil message
Fix for rapid7#7687
  • Loading branch information
David Maloney authored and David Maloney committed Dec 15, 2016
2 parents fa016de + e7eece6 commit ca1cc11
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/rex/logging/sinks/timestamp_flatfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module Sinks
class TimestampFlatfile < Flatfile

def log(sev, src, level, msg, from) # :nodoc:
return unless msg.present?
msg = msg.chop.gsub(/\x1b\[[0-9;]*[mG]/,'').gsub(/[\x01-\x02]/, " ")
fd.write("[#{get_current_timestamp}] #{msg}\n")
fd.flush
Expand Down
1 change: 1 addition & 0 deletions lib/rex/ui/text/shell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ def update_prompt(prompt = nil, new_prompt_char = nil, mode = false)
#
def print_error(msg='')
return if (output.nil?)
return if (msg.nil?)

self.on_print_proc.call(msg) if self.on_print_proc
# Errors are not subject to disabled output
Expand Down

0 comments on commit ca1cc11

Please sign in to comment.