From: Silvio Rhatto Date: Tue, 21 Aug 2012 17:12:50 +0000 (-0300) Subject: Initialization fixes X-Git-Tag: 0.2.1~57 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=f348c88f07380747149265f319c3c3a97bd4a047;p=keyringer.git Initialization fixes --- diff --git a/keyringer b/keyringer index 7089a08..a59fd2f 100755 --- a/keyringer +++ b/keyringer @@ -24,6 +24,10 @@ function keyringer_init { RECIPIENTS="$BASEDIR/config/recipients" OPTIONS="$BASEDIR/config/options" + # We are initializing, so avoid some checks + export KEYRINGER_CHECK_VERSION="false" + export KEYRINGER_CHECK_RECIPIENTS="false" + # Parse if [ -z "$BASEDIR" ]; then echo "Usage: $BASENAME init [url]" @@ -68,7 +72,7 @@ function keyringer_init { fi # Secure - chmod 600 "$RECIPIENTS" + chmod 700 "$RECIPIENTS" fi # Reparse basedir to force absolute folder diff --git a/lib/keyringer/functions b/lib/keyringer/functions index 6ac8bf8..dc1ce0f 100644 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -340,6 +340,10 @@ function keyringer_action_usage { # Check recipients function keyringer_check_recipients { + if [ "$KEYRINGER_CHECK_RECIPIENTS" == "false" ]; then + return + fi + # Check if recipients file is empty. if [ "`grep -vE "^#|^$" "$RECIPIENTS"/* | wc -l`" == 0 ] && [ "$SUBCOMMAND" != "edit" ]; then echo "Fatal: no recipients configured for this keyring."