[gnupg] gpgv --output FILE leaves FILE.part (regression in 2.5.21)

KOSHIKAWA Kenichi reishoku at reishoku.net
Sat Nov 7 05:01:27 CET 2026


Hello NIIBE-san,

NIIBE Yutaka wrote:
> One liner could fix the issue:
[...]
> I created a ticket for this:
>
>     https://static.dev.gnupg.org/T8540.html
 
Thank you for the fix and for pushing it (e10ce533).
 
I tested master (a6aa02c0) on Linux x86_64:
 
  - The recipe from my report now creates "out" with the signed text,
    and no out.part is left.
  - A bad signature gives exit code 1, as in 2.4.
  - An existing "out" is now replaced with the verified data.
  - "make -C tests/openpgp check": 64 succeeded, 0 failed, 3 skipped.

Outputs of the recipe described previously, as of a6aa02c0:

  $ git log -1 --format='%h %s'
  a6aa02c0 gpgsm: Use a separate source file also for KEM based encryption.
  $ git merge-base --is-ancestor e10ce533 a6aa02c0 && echo "e10ce533 is in a6aa02c0"
  e10ce533 is in a6aa02c0

  $ gpgv --version | head -n 1
  gpgv (GnuPG) 2.5.25-beta38
  $ gpgv --homedir home --keyring ./trusted.gpg --output out signed.asc
  gpgv: Signature made Sat Nov  7 03:47:15 2026 UTC
  gpgv:                using EDDSA key 81724F3A3B331D3DEB423ADFB70F62D0A395009F
  gpgv: Good signature from "Test <test at example.org>"
  $ echo $?
  0
  $ ls out*
  out
  $ cat out
  Hello

  Expected: out
  Actual:   out (previously: out.part)

Thanks,
Kenichi

-- 
KOSHIKAWA Kenichi
reishoku at reishoku.net


On Thu, Nov 05, 2026 at 02:16:52PM +0900, NIIBE Yutaka wrote:
> Hello,
> 
> Thank you for your report with repro.  I didn't notice until today
> (sorry, I rarely use gpgv).
> 
> KOSHIKAWA Kenichi wrote:
> >   ab2e64e4b490 gpg: Defer renaming at exit, so that it can remove
> >                on failure.  (T7873)
> 
> Ah, indeed.
> 
> One liner could fix the issue:
> ==========================
> diff --git a/g10/gpgv.c b/g10/gpgv.c
> index 382720ef8..9790cae3b 100644
> --- a/g10/gpgv.c
> +++ b/g10/gpgv.c
> @@ -322,6 +322,7 @@ g10_exit (int rc)
>    else if (opt.assert_pubkey_algos && assert_pubkey_algo_false)
>      rc = 1;
>  
> +  gnupg_commit_partial_file ();
>    exit (rc);
>  }
>  
> ==========================
> 
> I created a ticket for this:
> 
>     https://static.dev.gnupg.org/T8540.html
> -- 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 265 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-devel/attachments/20261107/752433ed/attachment.sig>


More information about the Gnupg-devel mailing list