pub enum ParseError {
Show 18 variants
Io(Error),
Header(HeaderError),
Pax(PaxError),
InvalidUtf8(Utf8Error),
PathTooLong {
len: usize,
limit: u32,
},
MetadataTooLarge {
size: u64,
limit: u32,
},
DuplicateGnuLongName,
DuplicateGnuLongLink,
DuplicatePaxHeader,
OrphanedMetadata,
TooManyPendingEntries {
count: usize,
limit: usize,
},
TooManySparseEntries {
count: usize,
limit: usize,
},
SparseNotGnu,
InvalidPaxSparseMap(Cow<'static, str>),
InvalidPaxValue {
key: &'static str,
value: Cow<'static, str>,
},
EmptyPath,
InvalidSize(u64),
UnexpectedEof {
pos: u64,
},
}Expand description
Errors that can occur during tar archive parsing.
Variants§
Io(Error)
I/O error from the underlying reader.
Header(HeaderError)
Header parsing error (checksum, invalid octal, etc.).
Pax(PaxError)
PAX extension parsing error.
InvalidUtf8(Utf8Error)
Invalid UTF-8 in PAX key.
PathTooLong
Path exceeds configured maximum length.
MetadataTooLarge
Extension metadata exceeds configured maximum size.
The aggregate size of all extension data (PAX headers, GNU long
name/link) for a single entry exceeded Limits::max_metadata_size.
DuplicateGnuLongName
Duplicate GNU long name entry without an intervening actual entry.
DuplicateGnuLongLink
Duplicate GNU long link entry without an intervening actual entry.
DuplicatePaxHeader
Duplicate PAX extended header without an intervening actual entry.
OrphanedMetadata
Metadata entries (GNU long name, PAX, etc.) found but no actual entry followed.
TooManyPendingEntries
Too many consecutive metadata entries (possible infinite loop or malicious archive).
TooManySparseEntries
Too many sparse entries (possible denial-of-service attack).
SparseNotGnu
Sparse entry type present but header is not GNU format.
InvalidPaxSparseMap(Cow<'static, str>)
A PAX sparse map field is malformed.
InvalidPaxValue
A PAX extension value failed to parse.
Fields
EmptyPath
Entry path is empty after applying all overrides (GNU long name, PAX path, etc.).
InvalidSize(u64)
Entry size in header is invalid (e.g., overflow when computing padded size).
UnexpectedEof
Unexpected EOF while reading entry content or padding.