fix formatting of b3f0bbedbf242d2640d3bc56cce62ae726081400 to conform to standard
authorJameson Rollins <jrollins@finestructure.net>
Sat, 2 Oct 2010 20:13:12 +0000 (16:13 -0400)
committerJameson Rollins <jrollins@finestructure.net>
Sat, 2 Oct 2010 20:13:12 +0000 (16:13 -0400)
src/share/common

index a741efb04455c51239f96771503771f765d2c396..50c9f61a3bc6e907cb06649c7427ea034e1139bc 100644 (file)
@@ -509,7 +509,7 @@ ssh2authorized_keys() {
     local userID="$2"
     local key="$3"
 
-    if [[ -z $koptions ]]; then
+    if [[ -z "$koptions" ]]; then
         printf "%s MonkeySphere%s %s\n" "$key" "$DATE" "$userID"
     else
         printf "%s %s MonkeySphere%s %s\n" "$koptions" "$key" "$DATE" "$userID"
@@ -1142,22 +1142,23 @@ update_authorized_keys() {
             koptions="$x"
         else
             userID="$x"
-       # process the user ID, change return code if key not found for
-       # user ID
-       process_uid_authorized_keys "$koptions" "$userID" || returnCode="$?"
 
-       # note the result
-       case "$returnCode" in
-           0)
-               nIDsOK=$((nIDsOK+1))
-               ;;
-           2)
-               nIDsBAD=$((nIDsBAD+1))
-               ;;
-       esac
-
-       # touch the lockfile, for good measure.
-       lock touch "$AUTHORIZED_KEYS"
+           # process the user ID, change return code if key not found
+           # for user ID
+           process_uid_authorized_keys "$koptions" "$userID" || returnCode="$?"
+
+           # note the result
+           case "$returnCode" in
+               0)
+                   nIDsOK=$((nIDsOK+1))
+                   ;;
+               2)
+                   nIDsBAD=$((nIDsBAD+1))
+                   ;;
+           esac
+
+           # touch the lockfile, for good measure.
+           lock touch "$AUTHORIZED_KEYS"
        fi
     done
 
@@ -1222,19 +1223,19 @@ process_authorized_user_ids() {
     IFS=$'\n'
     for line in $(meat "$authorizedUserIDs") ; do
        case "$line" in
-         (" "*|$'\t'*)
-           if [[ -z ${koptions[${nline}]} ]]; then
-               koptions[${nline}]=$(echo $line | sed 's/^[     ]*//;s/[        ]$//;')
-           else
-               koptions[${nline}]="${koptions[${nline}]},$(echo $line | sed 's/^[      ]*//;s/[        ]$//;')"
-           fi
-           ;;
-          (*)
-           ((nline++))
-           userIDs[${nline}]="$line"
-           unset koptions[${nline}] || true
-            ;;
-         esac
+           (" "*|$'\t'*)
+               if [[ -z ${koptions[${nline}]} ]]; then
+                   koptions[${nline}]=$(echo $line | sed 's/^[         ]*//;s/[        ]$//;')
+               else
+                   koptions[${nline}]="${koptions[${nline}]},$(echo $line | sed 's/^[  ]*//;s/[        ]$//;')"
+               fi
+               ;;
+            (*)
+               ((nline++))
+               userIDs[${nline}]="$line"
+               unset koptions[${nline}] || true
+               ;;
+       esac
     done
 
     for i in $(seq 1 $nline); do