From 1cfde8b57895ab300f47452d03da20e73f27032d Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 19 Jun 2008 03:33:29 -0400 Subject: [PATCH] monkeysphere-server should not bother adding the user-controlled authorized_keys file if it does not exist. --- src/monkeysphere-server | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/monkeysphere-server b/src/monkeysphere-server index f222130..96a1070 100755 --- a/src/monkeysphere-server +++ b/src/monkeysphere-server @@ -111,7 +111,7 @@ EOF log -n "generating server key... " echo "$keyParameters" | gpg --batch --gen-key - log "done." + loge "done." fingerprint_server_key } @@ -187,9 +187,11 @@ case $COMMAND in if [ "$USER_CONTROLLED_AUTHORIZED_KEYS" != '-' ] ; then userHome=$(getent passwd "$uname" | cut -d: -f6) userAuthorizedKeys=${USER_CONTROLLED_AUTHORIZED_KEYS/\%h/"$userHome"} - log -n "adding user's authorized_keys file... " - cat "$userAuthorizedKeys" >> "$AUTHORIZED_KEYS" - loge "done." + if [ -f "$userAuthorizedKeys" ] ; then + log -n "adding user's authorized_keys file... " + cat "$userAuthorizedKeys" >> "$AUTHORIZED_KEYS" + loge "done." + fi fi # move the temp authorized_keys file into place -- 2.25.1