summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJameson Rollins <jrollins@finestructure.net>2010-10-02 16:13:12 -0400
committerJameson Rollins <jrollins@finestructure.net>2010-10-02 16:13:12 -0400
commit2557eca7a3de0f3fef33260187cba824d5dd04b7 (patch)
tree2576517ecfce1b437fadd5607487f7c4539a6b03 /src
parentbd9c23125a2c27721ddfc74a4c21e17f641bb6bd (diff)
fix formatting of b3f0bbedbf242d2640d3bc56cce62ae726081400 to conform to standard
Diffstat (limited to 'src')
-rw-r--r--src/share/common59
1 files changed, 30 insertions, 29 deletions
diff --git a/src/share/common b/src/share/common
index a741efb..50c9f61 100644
--- a/src/share/common
+++ b/src/share/common
@@ -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