diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2022-08-25 15:59:07 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2022-08-25 16:02:22 -0400 |
commit | 7b43b64f669b7304253d67d3eff239828047dc26 (patch) | |
tree | ba817de23c4560874f12d925d69ff08f15f630e6 | |
parent | dee7eb1a2db35da5bc6fd97e5fb4484c6690c4d0 (diff) | |
download | patatt-7b43b64f669b7304253d67d3eff239828047dc26.tar.gz |
Use NamedTemporaryFile for gpg keyring creation
When we create the temporary keyring, use a NamedTemporaryFile so we
don't have to handle the cases where HOME or GNUPGHOME aren't writable.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | patatt/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/patatt/__init__.py b/patatt/__init__.py index af92091..7f6cbe2 100644 --- a/patatt/__init__.py +++ b/patatt/__init__.py @@ -394,7 +394,7 @@ class DevsigHeader: bsigdata = base64.b64decode(sigdata) vrfyargs = ['--verify', '--output', '-', '--status-fd=2'] if pubkey: - with tempfile.TemporaryFile(suffix='.patch-attest-poc') as temp_keyring: + with tempfile.NamedTemporaryFile(suffix='.patatt.gpg') as temp_keyring: keyringargs = ['--no-default-keyring', f'--keyring={temp_keyring.name}'] if pubkey in KEYCACHE: logger.debug('Reusing cached keyring') |