lanzaboote/rust/tool/systemd/src
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
..
architecture.rs tool(architecture): make it generic 2023-09-14 16:35:53 +02:00
cli.rs tool(architecture): make it generic 2023-09-14 16:35:53 +02:00
esp.rs tool(architecture): make it generic 2023-09-14 16:35:53 +02:00
install.rs tool: fix atomic write 2023-10-04 07:29:35 +02:00
lib.rs tool(architecture): make it generic 2023-09-14 16:35:53 +02:00
main.rs tool(architecture): make it generic 2023-09-14 16:35:53 +02:00
version.rs tool: split systemd into a new crate and make tool into a lib-only crate 2023-09-14 11:55:09 +02:00