Skip to content

Commit d085105

Browse files
committed
Keep reading external messages on stderr eof
1 parent be08af5 commit d085105

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/msf/core/modules/external/bridge.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@ def recv(filter_id=nil, timeout=600)
131131
raise EOFError.new
132132
else
133133
fds = res[0]
134-
# Preferentially drain and log stderr
135-
if fds.include? err
134+
# Preferentially drain and log stderr, EOF counts as activity, but
135+
# stdout might have some buffered data left, so carry on
136+
if fds.include?(err) && !err.eof?
136137
errbuf = err.readpartial(4096)
137138
elog "Unexpected output running #{self.path}:\n#{errbuf}"
138139
end

0 commit comments

Comments
 (0)