Marius Gedminas
2efb692cc4
known_hosts: support --diff ( #20349 )
...
* known_hosts: support --diff
* known_hosts: support --diff also without --check
* Add unit tests and fix incorrect diff in one corner case
Tests are good!
* Refactor for readability
* Python 3 compat
* More Python 3 compat
* Add an integration test for known_hosts
* Handle ssh-keygen -HF returning non-zero exit code
AFAICT this is a bug in ssh-keygen in some newer OpenSSH versions
(>= 6.4 probably; see commit dd9d5cc670 ):
when you invoke ssh-keygen with -H and -F <host> options, it always
returns exit code 1. This is because in ssh-keygen.c there's a function
do_known_hosts() which calls
exit (find_host && !ctx.found_key);
at the end, and find_host is 1 (because we passed -F on the command line),
but ctx.found_key is always 0. Why is found_key always 0? Because the
callback passed to hostkeys_foreach(), which is known_hosts_hash(),
never bothers to set found_key to 1.
* This test does not need root
* Avoid ssh-ed25519 keys in sample known_hosts file
Older versions of OpenSSH do not like them and ssh-keygen -HF
aborts with an error when it sees such keys:
line 5 invalid key: example.net...
/root/ansible_testing/known_hosts is not a valid known_hosts file.
* Fix Python 3 errors
Specifically, the default mode of tempfile.NamedTemporaryFile is 'w+b',
which means Python 3 wants us to write bytes objects to it -- but the
keys we have are all unicode strings.
2017-02-08 09:56:03 -05:00
..
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-12-12 14:19:47 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-11 14:50:57 -08:00
2016-11-11 14:50:57 -08:00
2017-01-25 13:05:44 +00:00
2016-11-29 21:21:53 -08:00
2017-01-27 14:06:21 -08:00
2016-11-29 21:21:53 -08:00
2017-01-03 09:32:32 -05:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-11 14:50:57 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2017-01-17 23:15:20 +01:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-10-12 14:57:53 -07:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-10-12 14:57:53 -07:00
2017-01-19 12:31:14 -05:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-11 14:50:57 -08:00
2017-01-09 17:21:04 +00:00
2016-11-11 14:50:57 -08:00
2016-11-11 14:50:57 -08:00
2017-01-09 17:21:04 +00:00
2016-11-11 14:50:57 -08:00
2016-11-11 14:50:57 -08:00
2017-01-09 17:21:04 +00:00
2016-11-11 14:50:57 -08:00
2017-01-12 18:02:35 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-11 14:50:57 -08:00
2017-01-09 17:21:04 +00:00
2016-11-11 14:50:57 -08:00
2016-11-11 14:50:57 -08:00
2017-01-09 17:21:04 +00:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2017-01-19 11:06:47 -08:00
2017-01-19 17:10:33 -08:00
2016-11-29 21:21:53 -08:00
2017-01-19 17:10:33 -08:00
2017-01-25 18:05:17 -08:00
2017-01-09 15:20:34 -08:00
2017-01-20 16:38:52 -08:00
2017-01-03 15:00:00 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2017-01-20 13:26:59 -08:00
2017-01-20 13:26:59 -08:00
2017-01-31 19:10:14 +00:00
2017-01-20 13:26:59 -08:00
2017-01-31 19:10:14 +00:00
2017-01-31 19:10:14 +00:00
2017-01-31 19:10:14 +00:00
2017-02-07 21:13:20 +01:00
2017-01-19 17:10:33 -08:00
2017-01-09 20:15:16 +00:00
2017-01-09 17:21:04 +00:00
2017-01-09 17:21:04 +00:00
2017-01-09 17:21:04 +00:00
2017-02-08 09:56:03 -05:00
2016-11-29 21:21:53 -08:00
2017-01-04 10:11:33 -08:00
2016-12-14 10:33:14 -05:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2017-02-02 17:48:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2017-01-17 11:06:34 +00:00
2016-11-29 21:21:53 -08:00
2016-11-11 14:50:57 -08:00
2017-01-09 17:21:04 +00:00
2016-11-11 14:50:57 -08:00
2016-11-11 14:50:57 -08:00
2017-01-09 17:21:04 +00:00
2017-01-03 10:53:16 -05:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2017-01-25 18:45:28 -08:00
2016-10-28 19:50:29 +01:00
2017-01-19 17:10:33 -08:00
2017-01-20 20:18:12 +00:00
2017-01-31 19:10:14 +00:00
2016-10-28 19:50:29 +01:00
2016-10-13 09:09:25 -07:00
2016-11-11 14:50:57 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-12-22 13:29:13 -08:00
2017-01-04 15:55:57 -08:00
2016-11-11 14:50:57 -08:00
2017-01-25 18:45:28 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2017-01-20 16:38:52 -08:00
2017-01-20 16:38:52 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2017-01-24 14:20:19 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2017-02-03 15:28:50 -05:00
2016-11-30 17:08:52 +00:00
2017-01-09 17:21:04 +00:00
2017-02-06 19:32:00 -05:00
2017-01-31 16:47:16 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2017-01-24 17:33:11 -08:00
2017-02-03 13:36:47 +01:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2017-01-17 20:21:04 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2017-01-26 20:06:46 +01:00
2016-12-13 13:51:13 -05:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2017-01-31 16:47:16 -08:00
2017-02-02 10:29:56 +01:00
2016-11-29 21:21:53 -08:00
2017-02-03 12:58:11 -08:00
2016-11-29 21:21:53 -08:00
2016-11-29 21:21:53 -08:00
2017-01-12 18:02:35 -08:00
2017-01-11 18:47:16 +00:00
2016-12-09 09:47:56 -05:00