X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=src%2Fshare%2Fma%2Fupdate_users;h=c5c74cf7bbfaedff9d410146b08ccb6a8193b153;hb=8aaf54d945f706b138c8465de70441d311ebac2f;hp=bfefc31cdb83b294175131d502136b17520e7ce5;hpb=ff8383ce9092335de6c00447bb45a2a7fbbf8685;p=monkeysphere.git diff --git a/src/share/ma/update_users b/src/share/ma/update_users index bfefc31..c5c74cf 100644 --- a/src/share/ma/update_users +++ b/src/share/ma/update_users @@ -13,6 +13,7 @@ update_users() { +local returnCode=0 local unames local uname local authorizedKeysDir @@ -23,11 +24,9 @@ if [ "$1" ] ; then 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" @@ -81,6 +80,7 @@ for uname in $unames ; do # 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 @@ -94,7 +94,7 @@ for uname in $unames ; do # process authorized_user_ids file, as monkeysphere user su_monkeysphere_user \ ". ${SYSSHAREDIR}/common; process_authorized_user_ids $TMP_AUTHORIZED_USER_IDS" \ - || RETURN="$?" + || returnCode="$?" else log debug "not processing authorized_user_ids." fi @@ -141,7 +141,7 @@ for uname in $unames ; do 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}" @@ -154,5 +154,5 @@ for uname in $unames ; do rm -rf "$TMPLOC" done -return $RETURN +return $returnCode }