The current implementation in tests/steps/process_steps.rs (line 70) uses NamedTempFile::persist() which overwrites existing files without explicit control.
Current code:
file.persist(&manifest_path)
.expect("Failed to persist manifest file");
Suggested alternatives:
- Use
fs::write for explicit file writing
- Use
NamedTempFile::persist_noclobber to avoid accidental overwrites
This change would provide more explicit control over file creation behavior and prevent unintended file overwrites.
Backlinks:
Requested by: @leynos
Rescope (2026-08-12)
The originally cited file tests/steps/process_steps.rs no longer exists. The sole remaining NamedTempFile::persist call is test_support/src/manifest.rs:103, which already treats ErrorKind::AlreadyExists as success rather than clobbering, so the original overwrite hazard is substantially mitigated. Remaining scope: adopt explicit no-clobber semantics at that call site, which is what PR #545 delivers. This issue closes with #545.
The current implementation in
tests/steps/process_steps.rs(line 70) usesNamedTempFile::persist()which overwrites existing files without explicit control.Current code:
Suggested alternatives:
fs::writefor explicit file writingNamedTempFile::persist_noclobberto avoid accidental overwritesThis change would provide more explicit control over file creation behavior and prevent unintended file overwrites.
Backlinks:
Requested by: @leynos
Rescope (2026-08-12)
The originally cited file
tests/steps/process_steps.rsno longer exists. The sole remainingNamedTempFile::persistcall istest_support/src/manifest.rs:103, which already treatsErrorKind::AlreadyExistsas success rather than clobbering, so the original overwrite hazard is substantially mitigated. Remaining scope: adopt explicit no-clobber semantics at that call site, which is what PR #545 delivers. This issue closes with #545.