[pass] Patch: exit 1 when gpg fails in multiline

the_jinx at etv.cx the_jinx at etv.cx
Thu Apr 23 03:10:46 CEST 2015


While I was working on QtPass I came upon a bug in pass where it exits 
with 0 when multiline inserts go wrong, for example when you have added 
someone to the .gpg-id file but not trusted his/her key.

As you can see it is a tiny little patch.

@@ -378,7 +378,7 @@ cmd_insert() {
  	if [[ $multiline -eq 1 ]]; then
  		echo "Enter contents of $path and press Ctrl+D when finished:"
  		echo
-		$GPG -e "${GPG_RECIPIENT_ARGS[@]}" -o "$passfile" "${GPG_OPTS[@]}"
+		$GPG -e "${GPG_RECIPIENT_ARGS[@]}" -o "$passfile" "${GPG_OPTS[@]}" || 
exit 1
  	elif [[ $noecho -eq 1 ]]; then
  		local password password_again
  		while true; do

I have also made a pull-request for this 
https://github.com/zx2c4/password-store/pull/14

Greetings,
     Anne Jan Brouwer


More information about the Password-Store mailing list