From 5c45092041c7d8271551db694ac5bc08729fde8d Mon Sep 17 00:00:00 2001 From: Julien Vincent Date: Mon, 12 Feb 2024 12:45:37 +0000 Subject: [PATCH] Ensure sig tmp file is closed before calling gpg --- lib/src/gpg_signing.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/src/gpg_signing.rs b/lib/src/gpg_signing.rs index a6b43bf465..17c692b183 100644 --- a/lib/src/gpg_signing.rs +++ b/lib/src/gpg_signing.rs @@ -119,13 +119,15 @@ impl SigningBackend for GpgBackend { signature_file.write_all(signature).map_err(GpgError::Io)?; signature_file.flush().map_err(GpgError::Io)?; + let sig_path = signature_file.into_temp_path(); + let output = self.run( data, &[ "--status-fd=1".as_ref(), "--verify".as_ref(), - signature_file.path().as_os_str(), /* the only reason we have those .as_refs - * transmuting to &OsStr everywhere.. */ + // the only reason we have those .as_refs transmuting to &OsStr everywhere + sig_path.as_os_str(), "-".as_ref(), ], false,