X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=src%2Fmonkeysphere;h=7e800cc4d61942f53deff20817f08633da6a8a74;hb=5c769e797dc0b867db7d6e19eaf9ca493dc87091;hp=78bf50ddac503388fe600bbf7751e40fa381f4ba;hpb=e1bcdeed65a6449b78f1f8090a49ce01ed0b872d;p=monkeysphere.git diff --git a/src/monkeysphere b/src/monkeysphere index 78bf50d..7e800cc 100755 --- a/src/monkeysphere +++ b/src/monkeysphere @@ -13,9 +13,9 @@ ######################################################################## PGRM=$(basename $0) -SHARE=${MONKEYSPHERE_SHARE:-"/usr/share/monkeysphere"} -export SHARE -. "${SHARE}/common" || exit 1 +SYSSHAREDIR=${MONKEYSPHERE_SYSSHAREDIR:-"/usr/share/monkeysphere"} +export SYSSHAREDIR +. "${SYSSHAREDIR}/common" || exit 1 # UTC date in ISO 8601 format if needed DATE=$(date -u '+%FT%T') @@ -36,7 +36,7 @@ umask 077 usage() { cat <&2 usage: $PGRM [options] [args] -MonkeySphere client tool. +Monkeysphere client tool. subcommands: update-known_hosts (k) [HOST]... update known_hosts file @@ -172,7 +172,7 @@ function subkey_to_ssh_agent() { if ! test_gnu_dummy_s2k_extension ; then failure "Your version of GnuTLS does not seem capable of using with gpg's exported subkeys. -You may want to consider patching or upgrading. +You may want to consider patching or upgrading to GnuTLS 2.6 or later. For more details, see: http://lists.gnu.org/archive/html/gnutls-devel/2008-08/msg00005.html" @@ -318,10 +318,12 @@ case $COMMAND in 'update-known_hosts'|'update-known-hosts'|'k') MODE='known_hosts' + # touch the known_hosts file so that the file permission check + # below won't fail upon not finding the file + (umask 0022 && touch "$KNOWN_HOSTS") + # check permissions on the known_hosts file path - if ! check_key_file_permissions "$USER" "$KNOWN_HOSTS" ; then - failure "Improper permissions on known_hosts file path." - fi + check_key_file_permissions "$USER" "$KNOWN_HOSTS" || failure # if hosts are specified on the command line, process just # those hosts @@ -347,14 +349,10 @@ case $COMMAND in MODE='authorized_keys' # check permissions on the authorized_user_ids file path - if ! check_key_file_permissions "$USER" "$AUTHORIZED_USER_IDS" ; then - failure "Improper permissions on authorized_user_ids file path." - fi + check_key_file_permissions "$USER" "$AUTHORIZED_USER_IDS" || failure # check permissions on the authorized_keys file path - if ! check_key_file_permissions "$USER" "$AUTHORIZED_KEYS" ; then - failure "Improper permissions on authorized_keys file path." - fi + check_key_file_permissions "$USER" "$AUTHORIZED_KEYS" || failure # exit if the authorized_user_ids file is empty if [ ! -e "$AUTHORIZED_USER_IDS" ] ; then