summaryrefslogtreecommitdiffstats
path: root/agent
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2022-06-23 04:05:51 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2022-06-23 04:05:51 +0200
commit99d2931887e5ba0db9007024b3420b110603d5be (patch)
treeaa78a319310d9df4c2b128daf09506fe5f524ded /agent
parentagent: KEYATTR only allows access to attribute. (diff)
downloadgnupg2-99d2931887e5ba0db9007024b3420b110603d5be.tar.xz
gnupg2-99d2931887e5ba0db9007024b3420b110603d5be.zip
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>
Diffstat (limited to 'agent')
-rw-r--r--agent/findkey.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/agent/findkey.c b/agent/findkey.c
index 8c128ce00..b0a941078 100644
--- a/agent/findkey.c
+++ b/agent/findkey.c
@@ -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));