Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ tar = { version = "0.4.42", default-features = false }
tempfile = "3.13.0"
thiserror = "2.0.4"
tokio = "1.41.0"
zerocopy = "0.8.13"
zstd = "0.13.2"

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use rustix::{
},
io::{read_uninit, write, Errno},
};
use zerocopy::IntoBytes;

use crate::{
fsverity::{digest::FsVerityHasher, Sha256HashValue},
Expand Down Expand Up @@ -153,8 +154,7 @@ impl FilesystemReader<'_> {

let mut buffer = [0; 65536];
for name in names.split_inclusive(|c| *c == 0) {
// SAFETY: casting i8 to u8 is safe.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

let name: &[u8] = unsafe { std::mem::transmute(name) };
let name: &[u8] = name.as_bytes();
let name = CStr::from_bytes_with_nul(name)?;
let value_size = getxattr(&filename, name, &mut buffer)?;
let key = Box::from(OsStr::from_bytes(name.to_bytes()));
Expand Down