pub struct PaxDecodePolicy { /* private fields */ }Expand description
Controls which otherwise valid pax features member decoding may accept.
See each allow API for its default.
Implementations§
Source§impl PaxDecodePolicy
impl PaxDecodePolicy
Sourcepub fn max_extension_size(self, max_extension_size: u64) -> Self
pub fn max_extension_size(self, max_extension_size: u64) -> Self
Configures the maximum payload size in bytes accepted for one pax extension.
The limit applies independently to each local or global extension and covers all records in that extension. An extension that declares a larger payload is rejected before its payload is consumed.
The default is DEFAULT_MAX_PAX_EXTENSION_SIZE. Setting the limit to
zero rejects every nonempty pax extension. Setting it to u64::MAX
removes the per-extension bound; global extensions remain subject to
their cumulative limit.
Sourcepub fn max_global_extensions_size(self, max_global_extensions_size: u64) -> Self
pub fn max_global_extensions_size(self, max_global_extensions_size: u64) -> Self
Configures the maximum cumulative payload size of global pax extensions.
The total is reset after each ordinary member. A global extension that
would increase the pending total beyond this limit is rejected before
its payload is consumed. The default is
DEFAULT_MAX_GLOBAL_PAX_EXTENSIONS_SIZE. Setting the limit to zero
rejects every nonempty global extension. Setting it to u64::MAX
removes the cumulative bound; each extension remains subject to its
individual limit.
Sourcepub fn allow_global_pax_extensions(self, allow: bool) -> Self
pub fn allow_global_pax_extensions(self, allow: bool) -> Self
Configures whether global pax extension headers may be accepted.
When enabled, Self::allow_global_pax_member_metadata separately
controls whether global path, linkpath, and size records are
accepted. Trailing global headers without a following ordinary member
are consumed and ignored before policy checks.
Global pax extension headers are allowed by default.
Sourcepub fn allow_unknown_pax_vendor_records(self, allow: bool) -> Self
pub fn allow_unknown_pax_vendor_records(self, allow: bool) -> Self
Configures whether unknown vendor-namespaced pax records may be accepted.
When enabled, well-formed vendor-namespaced pax records do not cause a decoding error. Their values are parsed structurally but their semantics are not interpreted or validated.
This can produce output that differs from the archive’s intended
contents. For example, GNU.sparse.* records can change a member’s
effective name, logical size, and mapping from stored payload bytes to
file contents; these semantics are ignored when this option is enabled.
IMPORTANT: Only enable this when silently ignoring unknown vendor semantics is acceptable. Unknown vendor-namespaced pax records are forbidden by default.
Sourcepub fn allow_duplicate_pax_records(self, allow: bool) -> Self
pub fn allow_duplicate_pax_records(self, allow: bool) -> Self
Configures whether one pax extended header may repeat a keyword.
When enabled, standard pax precedence applies and the last record for a repeated keyword takes effect.
Duplicated pax records within a single header are forbidden by default.
Sourcepub fn allow_global_pax_member_metadata(self, allow: bool) -> Self
pub fn allow_global_pax_member_metadata(self, allow: bool) -> Self
Configures whether global pax headers may set member path or size data.
When enabled, standard pax semantics permit global path, linkpath,
and size records to apply to following members until overridden.
Member metadata within global pax headers is forbidden by default, as it is extremely differential-prone.
Trait Implementations§
Source§impl Clone for PaxDecodePolicy
impl Clone for PaxDecodePolicy
Source§fn clone(&self) -> PaxDecodePolicy
fn clone(&self) -> PaxDecodePolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PaxDecodePolicy
Source§impl Debug for PaxDecodePolicy
impl Debug for PaxDecodePolicy
Source§impl Default for PaxDecodePolicy
impl Default for PaxDecodePolicy
impl Eq for PaxDecodePolicy
Source§impl PartialEq for PaxDecodePolicy
impl PartialEq for PaxDecodePolicy
Source§fn eq(&self, other: &PaxDecodePolicy) -> bool
fn eq(&self, other: &PaxDecodePolicy) -> bool
self and other values to be equal, and is used by ==.