Summary
The compress command in cli/src/main.rs was hardened in #45 with:
- Aliasing checks (
ensure_distinct_paths / paths_point_to_same_file) to reject identical or hard-linked input/output paths before any I/O.
- Atomic temporary-file publish (
create_temporary_output_file + replace_output_file) so the final destination is only replaced after a fully successful write, with permission preservation and platform-specific rename semantics.
The decompress command currently has neither of these protections. This issue tracks applying the same pattern to decompress.
Work items
References
Summary
The
compresscommand incli/src/main.rswas hardened in #45 with:ensure_distinct_paths/paths_point_to_same_file) to reject identical or hard-linked input/output paths before any I/O.create_temporary_output_file+replace_output_file) so the final destination is only replaced after a fully successful write, with permission preservation and platform-specific rename semantics.The
decompresscommand currently has neither of these protections. This issue tracks applying the same pattern todecompress.Work items
ensure_distinct_pathsat the start ofdecompress(before opening files).create_temporary_output_file.replace_output_file.compresserror-path cleanup).compresstests for aliasing rejection and temp-file cleanup on failure.References
ensure_distinct_paths,create_temporary_output_file,replace_output_fileincli/src/main.rs)