Skip to content

Commit

Permalink
Merge pull request #276 from wcampbell0x2a/fix-275-invalid-default-ids
Browse files Browse the repository at this point in the history
backhand: Fix FilesystemWriter::default() empty generation
  • Loading branch information
wcampbell0x2a authored Jul 9, 2023
2 parents ae9b3ee + 8b1cbca commit fcca5f5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# Unreleased
## backhand
### Bug Fix
- When creating an empty image using `FilesystemWriter::default()`, correctly create the ID table for UID and GID entries. Reported: ([@hwittenborn](https://github.com/hwittenborn)) ([!250](https://github.com/wcampbell0x2a/backhand/issues/275)), Fixed: ([#275](https://github.com/wcampbell0x2a/backhand/pull/275))

## All binaries
### Changes
- `strip` and `LTO` are enabled for release binaries
Expand Down
2 changes: 1 addition & 1 deletion src/filesystem/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl<'a> Default for FilesystemWriter<'a> {
Self {
block_size,
mod_time: 0,
id_table: vec![],
id_table: Id::root(),
fs_compressor: FilesystemCompressor::default(),
kind: Kind {
inner: Rc::new(LE_V4_0),
Expand Down
8 changes: 8 additions & 0 deletions tests/issues.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// https://github.com/wcampbell0x2a/backhand/issues/275
#[test]
#[cfg(feature = "xz")]
fn issue_275() {
let mut writer = std::io::Cursor::new(vec![]);
let mut fs = backhand::FilesystemWriter::default();
fs.write(&mut writer).unwrap();
}

0 comments on commit fcca5f5

Please sign in to comment.