Skip to content

Commit b9a7ed9

Browse files
committed
Land rapid7#7677, make sure the source file gets closed
... when downloading a file.
2 parents 4614b70 + 9a7c0eb commit b9a7ed9

File tree

1 file changed

+1
-0
lines changed
  • lib/rex/post/meterpreter/extensions/stdapi/fs

1 file changed

+1
-0
lines changed

lib/rex/post/meterpreter/extensions/stdapi/fs/file.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ def File.download_file(dest_file, src_file, opts = nil, &stat)
337337
if ::File.exist?(dest_file)
338338
dst_stat = ::File.stat(dest_file)
339339
if src_stat.size == dst_stat.size && src_stat.mtime == dst_stat.mtime
340+
src_fd.close
340341
return 'skipped'
341342
end
342343
end

0 commit comments

Comments
 (0)