diff options
author | Neal H. Walfield <[email protected]> | 2016-08-31 09:40:33 +0000 |
---|---|---|
committer | Neal H. Walfield <[email protected]> | 2016-08-31 09:47:50 +0000 |
commit | e4d5e3cb0d10e8f77c7100d42cfdb32051de1c18 (patch) | |
tree | fcc547b0926ccc976b6072d6728383f262777837 /g10/tofu.c | |
parent | g10: Fix the show old policy functionality when changing a TOFU policy. (diff) | |
download | gnupg-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 'g10/tofu.c')
-rw-r--r-- | g10/tofu.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/g10/tofu.c b/g10/tofu.c index 137065ad6..4285e960c 100644 --- a/g10/tofu.c +++ b/g10/tofu.c @@ -2584,6 +2584,8 @@ tofu_set_policy (ctrl_t ctrl, kbnode_t kb, enum tofu_policy policy) fingerprint = hexfingerprint (pk, NULL, 0); + begin_transaction (ctrl); + for (; kb; kb = kb->next) { PKT_user_id *user_id; @@ -2605,6 +2607,8 @@ tofu_set_policy (ctrl_t ctrl, kbnode_t kb, enum tofu_policy policy) xfree (email); } + end_transaction (ctrl, 0); + xfree (fingerprint); return 0; } |