Skip to content

Commit

Permalink
Land #10500, stack trace fix for jobs -K
Browse files Browse the repository at this point in the history
  • Loading branch information
wvu committed Aug 21, 2018
2 parents 230433c + 321f2b8 commit 682b086
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/msf/ui/console/command_dispatcher/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ def cmd_history(*args)

# Portable file truncation?
if File.writable?(Msf::Config.history_file)
File.open(Msf::Config.history_file, 'w') {}
File.write(Msf::Config.history_file, '')
end

print_good('Command history and history file cleared')
Expand Down
2 changes: 1 addition & 1 deletion lib/msf/ui/console/command_dispatcher/jobs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def cmd_jobs(*args)
framework.jobs.each_key do |i|
framework.jobs.stop_job(i)
end
File.truncate(Msf::Config.persist_file,0)
File.write(Msf::Config.persist_file, '') if File.writable?(Msf::Config.persist_file)
when "-i"
# Defer printing anything until the end of option parsing
# so we can check for the verbose flag.
Expand Down
4 changes: 2 additions & 2 deletions lib/msf/ui/console/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def initialize(prompt = DefaultPrompt, prompt_char = DefaultPromptChar, opts = {
restore_handlers = nil
end

unless restore_handlers.nil?
if restore_handlers
print_status("Starting persistent handler(s)...")

restore_handlers.each do |handler_opts|
Expand Down Expand Up @@ -560,4 +560,4 @@ def choose_readline(opts)

end
end
end
end

0 comments on commit 682b086

Please sign in to comment.