aboutsummaryrefslogtreecommitdiffstats
path: root/g10/gpg.c
diff options
context:
space:
mode:
authorNeal H. Walfield <[email protected]>2016-08-31 09:40:33 +0000
committerNeal H. Walfield <[email protected]>2016-08-31 09:47:50 +0000
commite4d5e3cb0d10e8f77c7100d42cfdb32051de1c18 (patch)
treefcc547b0926ccc976b6072d6728383f262777837 /g10/gpg.c
parentg10: Fix the show old policy functionality when changing a TOFU policy. (diff)
downloadgnupg-e4d5e3cb0d10e8f77c7100d42cfdb32051de1c18.tar.gz
gnupg-e4d5e3cb0d10e8f77c7100d42cfdb32051de1c18.zip
g10: Update a key's TOFU policy in a transaction.
* g10/tofu.c (tofu_set_policy): Do the update in a transaction. * g10/gpg.c (main): Do a TOFU policy update in a batch transaction. -- Signed-off-by: Neal H. Walfield <[email protected]>
Diffstat (limited to '')
-rw-r--r--g10/gpg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/g10/gpg.c b/g10/gpg.c
index 3193e7426..a9770d74a 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -4664,6 +4664,8 @@ main (int argc, char **argv)
if (! hd)
g10_exit (1);
+ tofu_begin_batch_update (ctrl);
+
for (i = 1; i < argc; i ++)
{
KEYDB_SEARCH_DESC desc;
@@ -4721,8 +4723,9 @@ main (int argc, char **argv)
g10_exit (1);
}
- keydb_release (hd);
+ tofu_end_batch_update (ctrl);
+ keydb_release (hd);
}
#endif /*USE_TOFU*/
break;