Add SMB AAPL Extensions Phase 1-6 + VFS xattr support
Phase 1: AAPL Create Context negotiation Phase 2: AFP_AfpInfo Stream structure (Finder info + creation time) Phase 2.5: SMB Named Stream Backend (NamedStreamPath) Phase 2.6: Backend Named Stream Support in handlers Phase 2.7: VFS Extended Attributes (get/set/remove/list_xattr) Phase 4: Time Machine share config (time_machine field) Phase 5: Server/Volume Capabilities Phase 6: macOS Unicode mapping (private range ↔ ASCII) Tests: 174 smb-server tests pass, 52 VFS tests pass
This commit is contained in:
20
vendor/smb-server/src/builder.rs
vendored
20
vendor/smb-server/src/builder.rs
vendored
@@ -45,6 +45,8 @@ pub struct Share {
|
||||
pub(crate) backend: Arc<dyn ShareBackend>,
|
||||
pub(crate) mode: ShareMode,
|
||||
pub(crate) users: HashMap<String, Access>,
|
||||
pub(crate) time_machine: bool,
|
||||
pub(crate) time_machine_max_size: Option<u64>,
|
||||
}
|
||||
|
||||
impl Share {
|
||||
@@ -55,6 +57,8 @@ impl Share {
|
||||
backend: Arc::new(backend),
|
||||
mode: ShareMode::AuthenticatedOnly,
|
||||
users: HashMap::new(),
|
||||
time_machine: false,
|
||||
time_machine_max_size: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,6 +80,20 @@ impl Share {
|
||||
self.users.insert(name.into(), access);
|
||||
self
|
||||
}
|
||||
|
||||
/// Enable Time Machine support for this share.
|
||||
/// macOS clients will be able to use this share for backups.
|
||||
pub fn time_machine(mut self) -> Self {
|
||||
self.time_machine = true;
|
||||
self
|
||||
}
|
||||
|
||||
/// Set maximum backup size in GB for Time Machine.
|
||||
pub fn time_machine_max_size(mut self, max_size_gb: u64) -> Self {
|
||||
self.time_machine = true;
|
||||
self.time_machine_max_size = Some(max_size_gb * 1024 * 1024 * 1024);
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -228,7 +246,7 @@ impl SmbServerBuilder {
|
||||
let mut share_bindings: Vec<Arc<ShareBindings>> = Vec::with_capacity(self.shares.len());
|
||||
for s in self.shares {
|
||||
share_bindings.push(ShareBindings::new(
|
||||
s.name, s.backend, s.mode, s.users, false,
|
||||
s.name, s.backend, s.mode, s.users, false, s.time_machine, s.time_machine_max_size,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user