Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions XSConsoleData.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,22 @@ def Create(self):
else:
self.data['sslfingerprint'] = "<Unknown>"

try:
self.data['sshfingerprint'] = ShellPipe('/usr/bin/ssh-keygen', '-lf', '/etc/ssh/ssh_host_rsa_key.pub').AllOutput()[0].split(' ')[1]
except:
self.data['sshfingerprint'] = Lang('<Unknown>')
def get_ssh_key(filename):
fingerprints = ShellPipe('/usr/bin/ssh-keygen', '-lf', filename).AllOutput()[0].split(' ')
return fingerprints[1] + ' ' + fingerprints[-1]

keytypes = ['rsa', 'ed25519', 'ecdsa']
fingerprints = []
for keytype in keytypes:
try:
fingerprints.append(get_ssh_key('/etc/ssh/ssh_host_%s_key.pub' % keytype))
except:
pass

if not fingerprints:
self.data['sshfingerprint'] = [Lang('<Unknown>')]
else:
self.data['sshfingerprint'] = fingerprints

try:
self.data['state_on_usb_media'] = ( ShellPipe('/bin/bash', '-c', 'source /opt/xensource/libexec/oem-functions; if state_on_usb_media; then exit 1; else exit 0; fi').CallRC() != 0 )
Expand Down
4 changes: 2 additions & 2 deletions XSConsoleTerm.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ def MainLoop(self):
# if gotKey is not None:
# bannerStr = gotKey

timeStr = time.strftime(" %H:%M:%S ", time.localtime())
statusLine = ("%-35s%10.10s%35.35s" % (bannerStr[:35], timeStr[:10], hostStr[:35]))
timeStr = time.strftime(" %H:%M:%S %Z [UTC%z] ", time.localtime())
statusLine = ("%-25s%28.28s%27.27s" % (bannerStr[:25], timeStr[:28], hostStr[:27]))
self.renderer.RenderStatus(self.layout.Window(Layout.WIN_TOPLINE), statusLine)

if self.needsRefresh:
Expand Down
251 changes: 0 additions & 251 deletions install-sh

This file was deleted.

5 changes: 3 additions & 2 deletions plugins-base/XSFeatureNetworkReset.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
interface_reconfigure = '%s/interface-reconfigure' % (Config.Inst().LibexecPath())
inventory_file = '/etc/xensource-inventory'
management_conf = '/etc/firstboot.d/data/management.conf'
network_reset = '/tmp/network-reset'
network_reset = '/var/tmp/network-reset'

def read_dict_file(fname):
f = open(fname, 'r')
Expand Down Expand Up @@ -63,7 +63,8 @@ def __init__(self):
f = open(pool_conf, 'r')
try:
l = f.readline()
ls = l.split(':')
# split "slave:ipaddress" such that IPv6 address is preserved
ls = l.split(':', maxsplit=1)
if ls[0] == 'slave':
self.master_ip = ls[1]
finally:
Expand Down
5 changes: 3 additions & 2 deletions plugins-base/XSFeatureStatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ def ActivateHandler(cls):
message = ''
message += Lang('Key fingerprint shown when connecting from '+appName+' (https)\n\n')
message += data.sslfingerprint('')+'\n\n'
message += Lang('Key fingerprint shown when logging in remotely (ssh)\n\n')
message += data.sshfingerprint('')
message += Lang('Key fingerprints shown when logging in remotely (ssh)\n\n')
for fingerprint in data.sshfingerprint(''):
message += fingerprint + '\n'

Layout.Inst().PushDialogue(InfoDialogue(Lang("SSL Key Fingerprints"), message))

Expand Down
Loading