lanzaboote/rust/tool/systemd
Alois Wohlschlager 90a1adac54
tool: fix atomic write
Atomic write works by first writing a temporary file, then syncing that
temporary file to ensure it is fully on disk before the program can
continue, and in the last step renaming the temporary file to the
target. The middle step was missing, which is likely to lead to a
truncated target file being present after power loss. Add this step.

Furthermore, even with this fix, atomicity is not fully guaranteed,
because FAT32 can become corrupted after power loss due to its design
shortcomings. Even though we cannot really do anything about this case,
adjust the comment to at least acknowledge the situation.
2023-10-04 07:29:35 +02:00
..
src tool: fix atomic write 2023-10-04 07:29:35 +02:00
tests tool: stop most overwriting in the ESP 2023-10-04 07:29:21 +02:00
Cargo.toml tool: make stubs input-addressed 2023-10-03 22:08:10 +02:00