aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2023-06-01 02:58:53 +0000
committerNIIBE Yutaka <[email protected]>2023-06-01 02:58:53 +0000
commitef4f22b9d98b4021796a607fb98016ef62c4c559 (patch)
tree8deac7504fe4e306885b74e99b99192a94e65f14
parentw32: Fix use of assuan_sendfd. (diff)
downloadgnupg-ef4f22b9d98b4021796a607fb98016ef62c4c559.tar.gz
gnupg-ef4f22b9d98b4021796a607fb98016ef62c4c559.zip
gpg: Graceful exit for signature checking with --batch.
* g10/mainproc.c (check_sig_and_print): Don't abort computation in the function, but returns an error. (proc_tree): Break the loop, when check_sig_and_print returns an error. -- GnuPG-bug-id: 6512 Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--g10/mainproc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/g10/mainproc.c b/g10/mainproc.c
index ce0fdaaac..7dea49728 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -2542,8 +2542,6 @@ check_sig_and_print (CTX c, kbnode_t node)
release_kbnode( keyblock );
if (rc)
g10_errors_seen = 1;
- if (opt.batch && rc)
- g10_exit (1);
}
else /* Error checking the signature. (neither Good nor Bad). */
{
@@ -2660,7 +2658,8 @@ proc_tree (CTX c, kbnode_t node)
}
for (n1 = node; (n1 = find_next_kbnode (n1, PKT_SIGNATURE));)
- check_sig_and_print (c, n1);
+ if (check_sig_and_print (c, n1) && opt.batch)
+ break;
}
else if (node->pkt->pkttype == PKT_GPG_CONTROL
@@ -2679,8 +2678,8 @@ proc_tree (CTX c, kbnode_t node)
}
for (n1 = node; (n1 = find_next_kbnode (n1, PKT_SIGNATURE));)
- check_sig_and_print (c, n1);
-
+ if (check_sig_and_print (c, n1) && opt.batch)
+ break;
}
else if (node->pkt->pkttype == PKT_SIGNATURE)
{
@@ -2807,7 +2806,8 @@ proc_tree (CTX c, kbnode_t node)
if (multiple_ok)
{
for (n1 = node; n1; (n1 = find_next_kbnode(n1, PKT_SIGNATURE)))
- check_sig_and_print (c, n1);
+ if (check_sig_and_print (c, n1) && opt.batch)
+ break;
}
else
check_sig_and_print (c, node);