Patchwork [2/2] dropbear: If a host key exists in /etc/dropbear it will be used - even for ro fs

login
register
mail settings
Submitter Kim B√łndergaard
Date Nov. 1, 2013, 8:55 a.m.
Message ID <7fce085bfb56ac0f4297f417bfa702702f864e7c.1383295764.git.kibo@prevas.dk>
Download mbox | patch
Permalink /patch/287742/
State Accepted
Delegated to: Esben Haabendal
Headers show

Comments

Kim B√łndergaard - Nov. 1, 2013, 8:55 a.m.
---
 recipes/dropbear/dropbear/init | 6 ++++++
 1 file changed, 6 insertions(+)
Esben Haabendal - Nov. 27, 2013, 1:29 p.m.
Merged to master, thanks.

/Esben

Patch

diff --git a/recipes/dropbear/dropbear/init b/recipes/dropbear/dropbear/init
index 90de8e9..b05997e 100755
--- a/recipes/dropbear/dropbear/init
+++ b/recipes/dropbear/dropbear/init
@@ -45,6 +45,12 @@  else
   DROPBEAR_DSSKEY_DEFAULT="/etc/dropbear/dropbear_dss_host_key"
 fi
 
+# If /etc file exist use this despite readonly
+test -e /etc/dropbear/dropbear_rsa_host_key && \
+	DROPBEAR_RSAKEY_DEFAULT="/etc/dropbear/dropbear_rsa_host_key"
+test -e /etc/dropbear/dropbear_dss_host_key && \
+	DROPBEAR_DSSKEY_DEFAULT="/etc/dropbear/dropbear_dss_host_key"
+
 test -z "$DROPBEAR_BANNER" || \
   DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER"
 test -n "$DROPBEAR_RSAKEY" || \