mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-11-05 14:57:30 +01:00
Fix use of Tempfile
git-svn-id: file:///home/svn/framework3/trunk@5246 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
parent
5131e4b747
commit
d6e5b0a25d
@ -395,6 +395,8 @@ module Db
|
||||
|
||||
fd.close
|
||||
|
||||
File.unlink(x.path)
|
||||
|
||||
load_nmap_xml(data)
|
||||
end
|
||||
|
||||
|
@ -60,6 +60,7 @@ class Nasm
|
||||
|
||||
# Remove temporary files
|
||||
File.unlink(opath)
|
||||
File.unlink(tpath)
|
||||
tmp.close
|
||||
|
||||
rv
|
||||
|
@ -107,12 +107,18 @@ class Plugin::DBSQLite3 < Msf::Plugin
|
||||
return
|
||||
end
|
||||
|
||||
IO.popen("#{sqlite3} \"#{opts['dbfile']}\" < \"#{sql}\"") do |io|
|
||||
io.each_line do |line|
|
||||
print_line("OUTPUT: " + line.strip)
|
||||
end
|
||||
|
||||
tmp = Tempfile.new("sqlXXXXXXX")
|
||||
|
||||
system("#{sqlite3} \"#{opts['dbfile']}\" < \"#{sql}\" >\"#{tmp.path}\" 2>&1")
|
||||
|
||||
tmp.read.each_line do |line|
|
||||
print_status("OUTPUT: #{line.strip}")
|
||||
end
|
||||
|
||||
tmp.close
|
||||
File.unlink(tmp.path)
|
||||
|
||||
if (not framework.db.connect(opts))
|
||||
raise PluginLoadError.new("Failed to connect to the database")
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user