From a6e6570102b1d060b81ca4b571fcd4428a2c4f54 Mon Sep 17 00:00:00 2001
From: Colleen Murphy <colleen@gazlene.net>
Date: Tue, 13 Oct 2015 17:54:09 -0700
Subject: [PATCH] Fix devuser pubkey defaults

Without this patch, the devuser element attempts to find public keys by
iterating over the string "rsa dsa". When two keys are grouped together
in quotes, a bash for loop treats it as a single key. You can see the
issue this causes when debug output is turned on:

   + for fmt in '"rsa dsa"'
   + '[' -f '/home/krinkle/.ssh/id_rsa dsa.pub' ']'

This is not a reasonably named key to look for, so this patch removes
the quotes so that the loop will look for id_rsa.pub and id_dsa.pub
separately.

Change-Id: I0b5b1abd14013de85d90e76a95918a8071a5e013
---
 elements/devuser/extra-data.d/50-devuser | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elements/devuser/extra-data.d/50-devuser b/elements/devuser/extra-data.d/50-devuser
index 3427b217c..9cbd09fe6 100755
--- a/elements/devuser/extra-data.d/50-devuser
+++ b/elements/devuser/extra-data.d/50-devuser
@@ -11,7 +11,7 @@ if [ -n "$DIB_DEV_USER_AUTHORIZED_KEYS" ]; then
         cat $DIB_DEV_USER_AUTHORIZED_KEYS >> $TMP_HOOKS_PATH/devuser-ssh-authorized-keys
     fi
 else
-    for fmt in "rsa dsa"; do
+    for fmt in rsa dsa; do
         if [ -f "$HOME/.ssh/id_$fmt.pub" ]; then
             cat $HOME/.ssh/id_$fmt.pub >> $TMP_HOOKS_PATH/devuser-ssh-authorized-keys
             break