From f09a8a6c6d8c06b9b855cf902e2a7129932a25e0 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 6 Sep 2012 21:20:39 +1000 Subject: - djm@cvs.openbsd.org 2012/08/17 01:25:58 [ssh-keygen.c] print details of which host lines were deleted when using "ssh-keygen -R host"; ok markus@ --- ChangeLog | 4 ++++ ssh-keygen.c | 22 +++++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd2877436..bbc4435df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,10 @@ [kex.c] add some comments about better handling first-KEX-follows notifications from the server. Nothing uses these right now. No binary change + - djm@cvs.openbsd.org 2012/08/17 01:25:58 + [ssh-keygen.c] + print details of which host lines were deleted when using + "ssh-keygen -R host"; ok markus@ 20120830 - (dtucker) [moduli] Import new moduli file. diff --git a/ssh-keygen.c b/ssh-keygen.c index a223ddc81..5060276d7 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-keygen.c,v 1.216 2012/07/06 06:38:03 jmc Exp $ */ +/* $OpenBSD: ssh-keygen.c,v 1.217 2012/08/17 01:25:58 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1994 Tatu Ylonen , Espoo, Finland @@ -1088,8 +1088,14 @@ do_known_hosts(struct passwd *pw, const char *name) ca ? " (CA key)" : ""); printhost(out, cp, pub, ca, 0); } - if (delete_host && !c && !ca) - printhost(out, cp, pub, ca, 0); + if (delete_host) { + if (!c && !ca) + printhost(out, cp, pub, ca, 0); + else + printf("# Host %s found: " + "line %d type %s\n", name, + num, key_type(pub)); + } } else if (hash_hosts) printhost(out, cp, pub, ca, 0); } else { @@ -1104,8 +1110,14 @@ do_known_hosts(struct passwd *pw, const char *name) printhost(out, name, pub, ca, hash_hosts && !ca); } - if (delete_host && !c && !ca) - printhost(out, cp, pub, ca, 0); + if (delete_host) { + if (!c && !ca) + printhost(out, cp, pub, ca, 0); + else + printf("# Host %s found: " + "line %d type %s\n", name, + num, key_type(pub)); + } } else if (hash_hosts) { for (cp2 = strsep(&cp, ","); cp2 != NULL && *cp2 != '\0'; -- cgit v1.2.3