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

Commit 454c2df

Browse files
jinankjainJinank Jain
authored andcommitted
fix #432: Fix the regression present in v0.33
ssh_keyscan is behaving weirdly when a port is passed to it as an argument. By weird what I mean is instead of sending output stdout it is redirected to stderr. This is a temporary fix and it needs more investigation why is that the case.
1 parent 6f74048 commit 454c2df

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)