macOS Time Machine AFP monitoring: backup_time update on file modification

- Added afp_monitor.rs module to track AFP_AfpInfo backup_time
- Open struct now has 'modified' flag to track file modifications
- write.rs sets modified=true on successful write
- close.rs calls AfpMonitor::update_backup_time() on modified files
- create.rs calls AfpMonitor::init_afp_info() on new file creation
- AFP_AfpInfo stored as xattr com.apple.aapl.AfpInfo
- backup_time updated to current epoch time on modification

Also includes:
- LZ4 compression using lz4_flex crate
- Case sensitivity conditional on backend capabilities
- LDAP cfg feature gate fix
- RAID rebuild reconstruction implementation
- DOS attributes xattr persistence
- Snapshot disk persistence

Tests: 201 smb-server, 452 markbase-core (653 total)
This commit is contained in:
Warren
2026-06-24 00:46:33 +08:00
parent 5300b672cb
commit 57fd6a475f
33 changed files with 1211 additions and 253 deletions
+7
View File
@@ -233,6 +233,8 @@ pub struct Session {
pub signing_required: bool,
/// Whether encryption is enabled for this session
pub encryption_enabled: bool,
/// Negotiated cipher algorithm for this session
pub encryption_cipher: Option<CipherAlgorithm>,
pub trees: RwLock<HashMap<u32, Arc<RwLock<TreeConnect>>>>,
/// 3.1.1: snapshot taken at SESSION_SETUP completion (after the request
/// hash but before the response is hashed). Used as KDF context.
@@ -250,6 +252,7 @@ impl Session {
encryption_key: Option<[u8; 16]>,
signing_required: bool,
encryption_enabled: bool,
encryption_cipher: Option<CipherAlgorithm>,
preauth_snapshot: Option<[u8; 64]>,
) -> Self {
Self {
@@ -260,6 +263,7 @@ impl Session {
encryption_key,
signing_required,
encryption_enabled,
encryption_cipher,
trees: RwLock::new(HashMap::new()),
preauth_snapshot,
next_tree_id: AtomicU32::new(1),
@@ -323,6 +327,8 @@ pub struct Open {
pub lease_key: Option<[u8; 16]>, // LeaseKey GUID
pub lease_state: Option<u32>, // LeaseState (READ/HANDLE/WRITE)
pub lease_flags: Option<u32>, // LeaseFlags (BREAKING etc.)
// AFP monitoring (Time Machine)
pub modified: bool, // Track if file was modified
}
impl Open {
@@ -349,6 +355,7 @@ impl Open {
lease_key: None,
lease_state: None,
lease_flags: None,
modified: false,
}
}
}