aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2023-03-11 13:57:58 -0300
committerSilvio Rhatto <rhatto@riseup.net>2023-03-11 13:57:58 -0300
commit5e9564f62128c681d8bbc3c319051f01b0ea5123 (patch)
treeb7660888058bab4d759e0c7da0198b9040029200 /lib
parent805f3ecc55897fe28d7054ecf7b29101582ceb75 (diff)
downloadkeyringer-5e9564f62128c681d8bbc3c319051f01b0ea5123.tar.gz
keyringer-5e9564f62128c681d8bbc3c319051f01b0ea5123.tar.bz2
Fix: edit: check whether decryption suceeded
Diffstat (limited to 'lib')
-rwxr-xr-xlib/keyringer/actions/edit6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/keyringer/actions/edit b/lib/keyringer/actions/edit
index a480eea..ae4f4b0 100755
--- a/lib/keyringer/actions/edit
+++ b/lib/keyringer/actions/edit
@@ -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"