=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/ssh-keyscan.c,v retrieving revision 1.125 retrieving revision 1.126 diff -u -r1.125 -r1.126 --- src/usr.bin/ssh/ssh-keyscan.c 2019/01/21 10:38:54 1.125 +++ src/usr.bin/ssh/ssh-keyscan.c 2019/01/26 22:35:01 1.126 @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-keyscan.c,v 1.125 2019/01/21 10:38:54 djm Exp $ */ +/* $OpenBSD: ssh-keyscan.c,v 1.126 2019/01/26 22:35:01 djm Exp $ */ /* * Copyright 1995, 1996 by David Mazieres . * @@ -64,6 +64,8 @@ int print_sshfp = 0; /* Print SSHFP records instead of known_hosts */ +int found_one = 0; /* Successfully found a key */ + #define MAXMAXFD 256 /* The number of seconds after which to give up on a TCP connection */ @@ -269,6 +271,8 @@ char *hostport; const char *known_host, *hashed; + found_one = 1; + if (print_sshfp) { export_dns_rr(host, key, stdout, 0); return; @@ -782,5 +786,5 @@ while (ncon > 0) conloop(); - return (0); + return found_one ? 0 : 1; }