diff options
| author | Hermes Agent <hermes@localhost> | 2026-08-12 06:02:57 +0000 |
|---|---|---|
| committer | Hermes Agent <hermes@localhost> | 2026-08-12 06:02:57 +0000 |
| commit | c7dc1a0173a14e9cb52adcb09ae566cf7eeb314a (patch) | |
| tree | 62661aaa98e09a9abadb676dec1863469464ce5a /src/build.rs | |
| parent | 35af190cac33650b90e8056b890b8c2c03dca7e7 (diff) | |
Protect companion manifests from overwrite
Diffstat (limited to 'src/build.rs')
| -rw-r--r-- | src/build.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/build.rs b/src/build.rs index 42c57ef..fcacfc0 100644 --- a/src/build.rs +++ b/src/build.rs @@ -42,6 +42,10 @@ impl<I: PackageInstaller, B: InitramfsBuilder> BuildExecutor<I, B> { if artifact.exists() { bail!("output artifact already exists; refusing to overwrite it: {}", artifact.display()); } + let manifest = ArtifactManifest::path_beside(artifact)?; + if manifest.exists() { + bail!("output manifest already exists; refusing to overwrite it: {}", manifest.display()); + } let parent = artifact .parent() .filter(|parent| !parent.as_os_str().is_empty()) |