]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Fix: edit: check whether decryption suceeded
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 11 Mar 2023 16:57:58 +0000 (13:57 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 11 Mar 2023 16:57:58 +0000 (13:57 -0300)
lib/keyringer/actions/edit

index a480eea5d2210e0d0d7e2920ee671a6975d48515..ae4f4b0e29adaac39608ab58e1b89a978e420527 100755 (executable)
@@ -24,6 +24,12 @@ keyringer_set_tmpfile $BASENAME.$EXTENSION
 # Decrypt the information to the file
 $GPG --yes -o "$TMPWORK" --use-agent -d "$KEYDIR/$FILE"
 
+# Check whether decryption suceeded
+if [ "$?" != "0" ]; then
+  echo "Error decrypting $FILE, aborting"
+  exit 1
+fi
+
 # Action check
 if [ "$BASENAME" == "edit" ]; then
   APP="$EDITOR"