Bug 2285 - Say NOT updated instead of updated
Summary: Say NOT updated instead of updated
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh-keygen (show other bugs)
Version: 6.6p1
Hardware: Other Linux
: P5 trivial
Assignee: Assigned to nobody
URL: http://bugs.debian.org/764269
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-07 07:22 AEDT by Dan Jacobson
Modified: 2015-08-11 23:02 AEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Jacobson 2014-10-07 07:22:28 AEDT
We observe that aside from the first run below,
the message "/home/jidanni/.ssh/known_hosts updated." is incorrect.
Using diff(1) we show that the contents remain the same.
Therefore in the latter cases, saying
"/home/jidanni/.ssh/known_hosts NOT updated."
would be better. Nor is there any reason to write a backup.

$ ssh-keygen -f "/home/jidanni/.ssh/known_hosts" -R m.jidanni.org
# Host m.jidanni.org found: line 2 type RSA
/home/jidanni/.ssh/known_hosts updated.
Original contents retained as /home/jidanni/.ssh/known_hosts.old
$ ssh-keygen -f "/home/jidanni/.ssh/known_hosts" -R m.jidanni.org
/home/jidanni/.ssh/known_hosts updated.
Original contents retained as /home/jidanni/.ssh/known_hosts.old
$ ssh-keygen -f "/home/jidanni/.ssh/known_hosts" -R m.jidanni.org
/home/jidanni/.ssh/known_hosts updated.
Original contents retained as /home/jidanni/.ssh/known_hosts.old
$ diff /home/jidanni/.ssh/known_hosts.old /home/jidanni/.ssh/known_hosts
$

Yes you might think it odd that a user would repeat the command by
accident perhaps, but even more odd are the incorrect messages.
Comment 1 Damien Miller 2015-05-01 13:49:38 AEST
This was fixed in openssh-6.8 by another change:

$ ./ssh-keygen -R test.example.com
# Host test.example.com found: line 157
home/djm/.ssh/known_hosts updated.
Original contents retained as /home/djm/.ssh/known_hosts.old
$ rm -f /home/djm/.ssh/known_hosts.old
$ ./ssh-keygen -R test.example.com
Host test.example.com not found in home/djm/.ssh/known_hosts
$ ls -l /home/djm/.ssh/known_hosts.old
ls: cannot access /home/djm/.ssh/known_hosts.old: No such file or directory
Comment 2 Damien Miller 2015-08-11 23:02:49 AEST
Set all RESOLVED bugs to CLOSED with release of OpenSSH 7.1