Skip to content
This repository was archived by the owner on Jan 24, 2022. It is now read-only.

Commit c9e57e4

Browse files
author
Jonathan Claudius
authored
Merge pull request #433 from jinankjain/fix432
fix #432: Fix the regression present in v0.33
2 parents 6f74048 + 454c2df commit c9e57e4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/ssh_scan/scan_engine.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ def scan_target(socket, opts)
125125
begin
126126
Timeout::timeout(timeout) {
127127
stdin, stdout, stderr, wait_thr = Open3.popen3('ssh-keyscan', '-t', 'rsa,dsa', '-p', port.to_s, target)
128-
output = stdout.gets(nil)
128+
output = stdout.gets(nil) if port.nil?
129129
stdout.close
130-
stderr.gets(nil)
130+
output = stderr.gets(nil) if !port.nil?
131131
stderr.close
132132
exit_code = wait_thr.value
133133
}

0 commit comments

Comments
 (0)