update_users() {
+local returnCode=0
local unames
local uname
local authorizedKeysDir
unames="$@"
else
# or just look at all users if none specified
- unames=$(getent passwd | cut -d: -f1)
+ unames=$(list_users)
fi
-RETURN=0
-
-# set mode
-MODE="authorized_keys"
-
# set gnupg home
GNUPGHOME="$GNUPGHOME_SPHERE"
# translating ssh-style path variables
authorizedUserIDs=$(translate_ssh_variables "$uname" "$AUTHORIZED_USER_IDS")
if [ -s "$authorizedUserIDs" ] ; then
+ log debug "authorized_user_ids file found."
# check permissions on the authorized_user_ids file path
if check_key_file_permissions "$uname" "$authorizedUserIDs" ; then
# copy user authorized_user_ids file to temporary
# process authorized_user_ids file, as monkeysphere user
su_monkeysphere_user \
- ". ${SYSSHAREDIR}/common; process_authorized_user_ids $TMP_AUTHORIZED_USER_IDS" \
- || RETURN="$?"
+ ". ${SYSSHAREDIR}/common; STRICT_MODES='$STRICT_MODES' process_authorized_user_ids $TMP_AUTHORIZED_USER_IDS" \
+ || returnCode="$?"
else
log debug "not processing authorized_user_ids."
fi
log error "Failed to install authorized_keys for '$uname'!"
rm -f "${authorizedKeysDir}/${uname}"
# indicate that there has been a failure:
- RETURN=1
+ returnCode=1
}
else
rm -f "${authorizedKeysDir}/${uname}"
rm -rf "$TMPLOC"
done
-return $RETURN
+return $returnCode
}