X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fmonkeysphere-server;h=d2cac0e673570f50630e2a664739c23623796b5e;hb=ac8f7d1c1addf1cea1c6ffb071de1fcfdc60931b;hp=3c4eed406774db0e9bcdb7795c91e43989520cf4;hpb=89cf6f46622a48e3ca1dd8df5037e4b02595631d;p=monkeysphere.git diff --git a/src/monkeysphere-server b/src/monkeysphere-server index 3c4eed4..d2cac0e 100755 --- a/src/monkeysphere-server +++ b/src/monkeysphere-server @@ -4,6 +4,7 @@ # # The monkeysphere scripts are written by: # Jameson Rollins +# Jamie McClelland # Daniel Kahn Gillmor # # They are Copyright 2008, and are all released under the GPL, version 3 @@ -33,7 +34,7 @@ RETURN=0 ######################################################################## usage() { - cat <&2 usage: $PGRM [options] [args] MonkeySphere server admin tool. @@ -156,7 +157,7 @@ update_users() { for uname in $unames ; do # check all specified users exist if ! getent passwd "$uname" >/dev/null ; then - log "----- unknown user '$uname' -----" + log error "----- unknown user '$uname' -----" continue fi @@ -172,17 +173,17 @@ update_users() { fi fi - log "----- user: $uname -----" + log verbose "----- user: $uname -----" # exit if the authorized_user_ids file is empty if ! check_key_file_permissions "$uname" "$AUTHORIZED_USER_IDS" ; then - log "Improper permissions on authorized_user_ids file path." + log error "Improper permissions on path '$AUTHORIZED_USER_IDS'." continue fi # check permissions on the authorized_keys file path if ! check_key_file_permissions "$uname" "$RAW_AUTHORIZED_KEYS" ; then - log "Improper permissions on authorized_keys file path path." + log error "Improper permissions on path '$RAW_AUTHORIZED_KEYS'." continue fi @@ -226,9 +227,8 @@ update_users() { # add user-controlled authorized_keys file path if specified if [ "$rawAuthorizedKeys" != '-' -a -s "$rawAuthorizedKeys" ] ; then - log -n "adding raw authorized_keys file... " + log verbose "adding raw authorized_keys file... " cat "$rawAuthorizedKeys" >> "$AUTHORIZED_KEYS" - loge "done." fi # openssh appears to check the contents of the @@ -308,12 +308,7 @@ gen_key() { fi # prompt about key expiration if not specified - if [ -z "$keyExpire" ] ; then - keyExpire=$(get_gpg_expiration) - fi - if ! test_gpg_expire "$keyExpire" ; then - failure "invalid key expiration value '$keyExpire'." - fi + keyExpire=$(get_gpg_expiration "$keyExpire") # set key parameters keyParameters=$(cat < "${VARLIB}/ssh_host_rsa_key") - log "Private SSH host key output to file: ${VARLIB}/ssh_host_rsa_key" + log info "Private SSH host key output to file: ${VARLIB}/ssh_host_rsa_key" } # extend the lifetime of a host key: @@ -382,12 +377,8 @@ extend_key() { failure "You don't appear to have a MonkeySphere host key on this server. Try 'monkeysphere-server gen-key' first." fi - if [ -z "$extendTo" ]; then - extendTo=$(get_gpg_expiration) - fi - if ! test_gpg_expire "$extendTo" ; then - failure "invalid expiration value '$extendTo'." - fi + # get the new expiration date + extendTo=$(get_gpg_expiration "$extendTo") gpg_host --quiet --command-fd 0 --edit-key "$fpr" <