1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-23 10:29:58 +01:00

agent: Flush before calling ftruncate.

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

--

Cherry-picked from master commit of:
	99d2931887e5ba0db9007024b3420b110603d5be

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 4c14bbf56f
commit 9e2307ddf0

View File

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