From ed2a11ad132ac593df6a0e2560e4563b540a4bb8 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 3 Jul 2007 14:56:29 +0100 Subject: [PATCH] Fix filename pattern bug which can prevent automatic keypair generation (false claim that privkey and pubkey do not match). New adt_sshauthkeys_hook config variable. --- xen/README | 7 ++++++- xen/fixups | 5 ++++- xen/readconfig.in | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/xen/README b/xen/README index 878b626..02b1cc4 100644 --- a/xen/README +++ b/xen/README @@ -116,9 +116,14 @@ adt_fw_allowglobalports outgoing connections. adt_fw_hook with _config replaced with _fwhook - or none of doesn't end in _config + or none if doesn't end in _config bash fragment to source during firewall setup +adt_sshauthkeys_hook with _config replaced with _sshauthkeys + or none if doesn't end in _config + list of authorized keys to append to testbed's + /root/.ssh/authorized_keys. + ---------- Items that are likely to need attention ---------- adt_kernel Xen kernel matching /boot/xen*`uname -r` diff --git a/xen/fixups b/xen/fixups index 6c48866..151e266 100755 --- a/xen/fixups +++ b/xen/fixups @@ -14,7 +14,7 @@ cp -a "${adt_modules}" $dest/lib/modules/. echo xennet >>$dest/etc/modules if ! test -f "${adt_ssh_pubkey}"; then - if [ "x${adt_ssh_pubkey}" != "x${adt_ssh_privkey}.priv" ]; then + if [ "x${adt_ssh_pubkey}" != "x${adt_ssh_privkey}.pub" ]; then fail "cannot generate keypair automatically because adt_ssh_privkey \`$adt_ssh_privkey' and adt_ssh_pubkey \`$adt_ssh_pubkey' do not match up in the way required by ssh-keygen ( must be .pub>" fi if test -f "${adt_ssh_privkey}"; then @@ -27,6 +27,9 @@ fi mkdir -m 02700 -p $dest/root/.ssh cp -- "${adt_ssh_pubkey}" $dest/root/.ssh/authorized_keys +if [ "x$adt_sshauthkeys_hook" != x ]; then + cat -- "$adt_sshauthkeys_hook" >>$dest/root/.ssh/authorized_keys +fi cat <$dest/etc/init.d/xenethtoolk #!/bin/sh diff --git a/xen/readconfig.in b/xen/readconfig.in index a30c1ca..efb8423 100644 --- a/xen/readconfig.in +++ b/xen/readconfig.in @@ -259,6 +259,7 @@ search_hook () { search_hook fw firewall fwhook search_hook setup setup setuphook +search_hook sshauthkeys "ssh auth keys" sshauthkeys boolean_config () { eval ' -- 2.30.2