Skip to main content

ExtendedMetadataCapture

Struct ExtendedMetadataCapture 

Source
pub struct ExtendedMetadataCapture {
    pub file_acl: bool,
    pub dir_acl: bool,
    pub root_acl_notice: bool,
}
Expand description

What EXTENDED metadata the SOURCE must read, beyond the stat it already does.

Two of the three fields are per-entry reads whose bytes are sent; the third buys one read on the ROOT whose only product is a log line. All three answer the same question — what may the source spend an xattr syscall on — so with every field false the source issues none, EXCEPT under --require-toctou-safe: that flag arms the root notice from the source’s own mirrored copy of it rather than from here, so a strict run still pays the one root listxattr on an all-false capture. Nothing per-entry is reachable that way — only file_acl/dir_acl open that door.

Carried in MasterHello::Source because the source otherwise has no way to know: only MasterHello::Destination carries preserve, so without this the source would have to probe unconditionally and every remote copy — including every one that does not want ACLs — would pay a syscall per entry that stat cannot fold in. That cost is the whole reason acl is opt-in.

Deliberately NOT the whole preserve struct, and named for what it is. The source decides only what to READ; the destination remains the sole authority on what is APPLIED. Handing the source a preserve would invite a later reader to act on, say, preserve.file.mode_mask source-side, which would be a bug. Every field MasterHello::Source already carries (filter, dry_run) is of this same “what to read/send” kind. The name leaves room for an -X-style xattr option to land here rather than growing another field.

Fields§

§file_acl: bool

Read each source FILE’s system.posix_acl_access.

§dir_acl: bool

Read each source DIRECTORY’s access AND default ACLs.

§root_acl_notice: bool

Probe the source ROOT once for a POSIX ACL, so the source can say that this copy will not carry it across (see common::safedir::RootAclNotice).

Independent of the two above: it is armed by the master’s preserve asking for metadata fidelity AT ALL, and disarmed by a copy that asked for none — the reads above are armed by preserve asking for acl specifically, which is the case where there is nothing to warn about. A run at the shipped default sets all three to false and the source touches no xattr.

Implementations§

Source§

impl ExtendedMetadataCapture

Source

pub fn for_preserve(preserve: &Settings) -> Self

What a copy preserving preserve requires the source to read.

The ONE derivation, called at the single master site that also sends preserve to the destination, so the two cannot disagree. That matters: the destination treats an all-None Metadata::acls as “the source had none, so CLEAR”, so a capture that said false while the destination’s preserve said true would silently strip every ACL instead of copying it. Symlinks are absent by construction — the kernel has no symlink ACL, and the settings parser rejects l:acl.

Trait Implementations§

Source§

impl Clone for ExtendedMetadataCapture

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ExtendedMetadataCapture

Source§

impl Debug for ExtendedMetadataCapture

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ExtendedMetadataCapture

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ExtendedMetadataCapture

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ExtendedMetadataCapture

Source§

impl From<ExtendedMetadataCapture> for RootAclNotice

Source§

fn from(capture: ExtendedMetadataCapture) -> Self

The source’s view of the notice, reassembled from what crossed the wire.

--require-toctou-safe is absent here on purpose: it reaches the source rcpd as its own mirrored flag and is read from the process-global strict state, so it arms the notice on the host that actually runs the probe rather than travelling twice.

Source§

impl PartialEq for ExtendedMetadataCapture

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ExtendedMetadataCapture

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ExtendedMetadataCapture

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more