]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Initialization fixes
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 21 Aug 2012 17:12:50 +0000 (14:12 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 21 Aug 2012 17:12:50 +0000 (14:12 -0300)
keyringer
lib/keyringer/functions

index 7089a081817414398ff7c6f16334723537778078..a59fd2f93cd0edaff2ebbb2266546da8dc47d6bc 100755 (executable)
--- 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 <keyring> init <path> [url]"
@@ -68,7 +72,7 @@ function keyringer_init {
     fi
 
     # Secure
-    chmod 600 "$RECIPIENTS"
+    chmod 700 "$RECIPIENTS"
   fi
 
   # Reparse basedir to force absolute folder
index 6ac8bf834ed597ac473f24b40fd1bb35d0203f89..dc1ce0f4e23274bb3a7faa026df24098a20d689e 100644 (file)
@@ -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."