(cherry picked from commit bc7133d752
)
Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
This commit is contained in:
@ -103,8 +103,9 @@ where
|
|||||||
let parts: Vec<_> = parts.map(|p| p.unwrap()).collect();
|
let parts: Vec<_> = parts.map(|p| p.unwrap()).collect();
|
||||||
if !entry_checker(parts.as_slice(), entry.header().entry_type()) {
|
if !entry_checker(parts.as_slice(), entry.header().entry_type()) {
|
||||||
return Err(UnpackError::Archive(format!(
|
return Err(UnpackError::Archive(format!(
|
||||||
"extra entry found: {:?}",
|
"extra entry found: {:?} {:?}",
|
||||||
path_str
|
path_str,
|
||||||
|
entry.header().entry_type(),
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
total_size = checked_total_size_sum(total_size, entry.header().size()?, limit_size)?;
|
total_size = checked_total_size_sum(total_size, entry.header().size()?, limit_size)?;
|
||||||
@ -451,7 +452,7 @@ mod tests {
|
|||||||
let mut archive = Builder::new(Vec::new());
|
let mut archive = Builder::new(Vec::new());
|
||||||
archive.append(&header, data).unwrap();
|
archive.append(&header, data).unwrap();
|
||||||
let result = finalize_and_unpack_snapshot(archive);
|
let result = finalize_and_unpack_snapshot(archive);
|
||||||
assert_matches!(result, Err(UnpackError::Archive(ref message)) if message == "extra entry found: \"foo\"");
|
assert_matches!(result, Err(UnpackError::Archive(ref message)) if message == "extra entry found: \"foo\" Regular");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Reference in New Issue
Block a user