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: boolRead each source FILE’s system.posix_acl_access.
dir_acl: boolRead each source DIRECTORY’s access AND default ACLs.
root_acl_notice: boolProbe 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
impl ExtendedMetadataCapture
Sourcepub fn for_preserve(preserve: &Settings) -> Self
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
impl Clone for ExtendedMetadataCapture
impl Copy for ExtendedMetadataCapture
Source§impl Debug for ExtendedMetadataCapture
impl Debug for ExtendedMetadataCapture
Source§impl Default for ExtendedMetadataCapture
impl Default for ExtendedMetadataCapture
Source§impl<'de> Deserialize<'de> for ExtendedMetadataCapture
impl<'de> Deserialize<'de> for ExtendedMetadataCapture
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ExtendedMetadataCapture
Source§impl From<ExtendedMetadataCapture> for RootAclNotice
impl From<ExtendedMetadataCapture> for RootAclNotice
Source§fn from(capture: ExtendedMetadataCapture) -> Self
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
impl PartialEq for ExtendedMetadataCapture
Source§impl Serialize for ExtendedMetadataCapture
impl Serialize for ExtendedMetadataCapture
impl StructuralPartialEq for ExtendedMetadataCapture
Auto Trait Implementations§
impl Forget for ExtendedMetadataCapture
impl Freeze for ExtendedMetadataCapture
impl Move for ExtendedMetadataCapture
impl RefUnwindSafe for ExtendedMetadataCapture
impl Send for ExtendedMetadataCapture
impl Sync for ExtendedMetadataCapture
impl Unpin for ExtendedMetadataCapture
impl UnsafeUnpin for ExtendedMetadataCapture
impl UnwindSafe for ExtendedMetadataCapture
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request