Skip to content

Commit 9b92d0d

Browse files
committed
Use Rex::Compat.open_file to open profiling report
MSP-11368 Use Rex::Compat.open_file instead of `system('open <pdf>')` so that opening the pdf works on Linux in addition to OSX.
1 parent b863978 commit 9b92d0d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

msfconsole

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,12 @@ if ENV['METASPLOIT_FRAMEWORK_PROFILE'] == 'true'
2727

2828
puts "Generating pdf"
2929

30-
pdf_pathname = "#{profile_pathname}.pdf"
30+
pdf_path = "#{profile_pathname}.pdf"
3131

32+
if Bundler.clean_system("pprof.rb --pdf #{profile_pathname} > #{pdf_path}")
33+
puts "PDF saved to #{pdf_path}"
3234

33-
if Bundler.clean_system("pprof.rb --pdf #{profile_pathname} > #{pdf_pathname}")
34-
puts "PDF saved to #{pdf_pathname}"
35-
36-
system("open #{pdf_pathname}")
35+
Rex::Compat.open_file(pdf_path)
3736
end
3837
}
3938
end

0 commit comments

Comments
 (0)