summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-gpg-verifier.c
diff options
context:
space:
mode:
authorDan Nicholson <nicholson@endlessm.com>2019-01-10 14:00:42 -0600
committerAtomic Bot <atomic-devel@projectatomic.io>2019-06-19 17:30:24 +0000
commitb6979e7572395f3f99ba328ed9399ed4b862f9a7 (patch)
tree58e1ecfa8d29755332a7b3d44c069142fdc6646a /src/libostree/ostree-gpg-verifier.c
parent4670837f7c9d027b8724c4061219ee951dc8cd6e (diff)
downloadostree-b6979e7572395f3f99ba328ed9399ed4b862f9a7.tar.gz
lib: Kill GPG agent when cleaning up tmp homedirs
When a temporary directory is used for GPG operations, it's pretty clear that the running agent will be useless after the directory is deleted. Call the new `ot_gpgme_kill_agent ()` helper to kill gpg-agent rather than leaving them it hanging around forever. As it turns out, gnupg does have code to make gpg-agent automatically exit when the homedir is removed (https://dev.gnupg.org/T2756), but that's only available on gnupg 2.2 or newer. Possibly this code can be dropped later when that's more widely deployed or users/distros have been advised to backport the necessary changes. Closes: #1799 Approved by: cgwalters
Diffstat (limited to 'src/libostree/ostree-gpg-verifier.c')
-rw-r--r--src/libostree/ostree-gpg-verifier.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libostree/ostree-gpg-verifier.c b/src/libostree/ostree-gpg-verifier.c
index a279348e..95ed36ee 100644
--- a/src/libostree/ostree-gpg-verifier.c
+++ b/src/libostree/ostree-gpg-verifier.c
@@ -87,6 +87,7 @@ verify_result_finalized_cb (gpointer data,
* finalize() method, but I didn't want this keyring hack
* bleeding into multiple classes. */
+ ot_gpgme_kill_agent (tmp_dir);
(void) glnx_shutil_rm_rf_at (AT_FDCWD, tmp_dir, NULL, NULL);
}