Ticket #869 (closed defect: fixed)

Opened 13 years ago

Last modified 13 years ago

SSHbase generates a ssh_known_hosts file with hosts, ip's & aliases in inconsistent order

Reported by: 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]


RHEL5.4, bcfg2 1.0.1

An excerpt from running bcfg2 -qveI (with ip & hostnames changed)

+,host1,host1.domain ssh-rsa AAAA....ASD==
+host2,, 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:


>                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.


Change History

comment:1 Changed 13 years ago by solj

  • Status changed from new to closed
  • Resolution set to fixed

Added in [f7cdad6b141b86eeb6e52c0ba590f475d166aa65] (SVN r5793). Thanks for the patch!

WARNING! You need to establish a session before you can create or edit tickets. Otherwise the ticket will get treated as spam.


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.