aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-11-25 08:48:37 +0100
committerGravatar Christian Hesse <mail@eworm.de>2020-11-25 08:48:37 +0100
commited06fb5d80bc0425a00860aec2db119189c4ee97 (patch)
tree04eb5af5700f7dcfe1cfcec1b0cd1648859b7961
parente7ceabd8096686f9893286464a58693e4d09b44f (diff)
downloadmkinitcpio-ykfde-ed06fb5d80bc0425a00860aec2db119189c4ee97.tar.gz
mkinitcpio-ykfde-ed06fb5d80bc0425a00860aec2db119189c4ee97.tar.zst
sync challenge file to disk before closing
-rw-r--r--bin/ykfde.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/ykfde.c b/bin/ykfde.c
index 56a2832..8a766e5 100644
--- a/bin/ykfde.c
+++ b/bin/ykfde.c
@@ -312,6 +312,10 @@ int main(int argc, char **argv) {
fprintf(stderr, "Failed to write challenge to file.\n");
goto out50;
}
+ if (fsync(challengefiletmp) < 0) {
+ fprintf(stderr, "Failed to sync file to disk.\n");
+ goto out50;
+ }
challengefiletmp = close(challengefiletmp);
/* now that the new challenge has been written to file...