Modify ↓
Ticket #869 (closed defect: fixed)
SSHbase generates a ssh_known_hosts file with hosts, ip's & aliases in inconsistent order
Reported by: | https://www.google.com/accounts/o8/id?id=AItOawlo86Mt9tqt2k06humTEpjOdekfWJoTv4M | Owned by: | desai |
---|---|---|---|
Priority: | major | Milestone: | Bcfg2 1.1.0 Release |
Component: | bcfg2-client | Version: | 1.0 |
Keywords: | SSHbase ssh_known_hosts | Cc: | [email protected]… |
Description
RHEL5.4, bcfg2 1.0.1
An excerpt from running bcfg2 -qveI (with ip & hostnames changed)
+10.0.0.1,host1,host1.domain ssh-rsa AAAA....ASD== +host2,10.0.0.2, host2.domain ssh-rsa AAAA....DSA== Install ConfigFiles /etc/ssh/ssh_known_hosts: (y/N):
Because the order of a python set is dependent on the order of the hash of entries of that set, the get_skn method generates a entries in the ssh_known_hosts with the names ordered according to their has instead of a consistent (from the user point of view) order. Some entries are IP, hostname and other entries are hostname, IP.
This patch corrects that:
Bcfg2/Server/Plugins/SSHbase.py
90a91 > names[cmeta.hostname] = sorted(names[cmeta.hostname])
The overhead of sorting the names set is only incurred upon bcfg2-server startup since the skn file is cached in memory and shouldn't be significant.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
Added in [f7cdad6b141b86eeb6e52c0ba590f475d166aa65] (SVN r5793). Thanks for the patch!