1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

agent: Flush before calling ftruncate.

* agent/findkey.c (write_extended_private_key): Make sure
it is flushed out.

--

GnuPG-bug-id: 6035
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2022-06-23 11:05:51 +09:00
parent 26d5a6e862
commit 99d2931887

View File

@ -172,6 +172,8 @@ write_extended_private_key (char *fname, estream_t fp, int update, int newkey,
goto leave;
err = nvc_write (pk, fp);
if (!err)
err = es_fflush (fp);
if (err)
{
log_error ("error writing '%s': %s\n", fname, gpg_strerror (err));