Warren
614275f77a
Add SMB Client Restrictions (Phase 1-3): access control for SMB clients
...
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
Features:
- IpSpec: IP address specification (Single/Cidr/Range/Any)
- TimeSpec: Time-based restrictions (HourRange/DayOfWeek/DayHour)
- ClientRule: Allow/Deny rules with IP/user/time/share
- ClientAcl: Priority-based rule matching
- ClientRestrictionManager: Global/Share/User ACLs
Security:
- Restrict SMB client access by IP address
- Time-based access control (business hours only)
- User-specific and share-specific ACLs
- CIDR notation support (192.168.1.0/24)
Files:
- vendor/smb-server/src/client_restrictions.rs (443 lines)
- vendor/smb-server/src/lib.rs (+1 line)
Tests: 7 passed (smb-server), 317 passed (markbase-core)
2026-06-21 12:51:37 +08:00
Warren
a28b7f0929
Add SMB Share Snapshots (Phase 1-4): FSCTL_SRV_SNAPSHOT_* handlers
...
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
Features:
- SnapshotManager: Share snapshot management
- SnapshotEntry/SnapshotState: Snapshot metadata structures
- FSCTL_SRV_SNAPSHOT_CREATE/READ/WRITE/DELETE handlers
- GMT token format support (@GMT-YYYY.MM.DD-HH.MM.SS)
- 7 unit tests for all operations
Files:
- vendor/smb-server/src/snapshot.rs (245 lines)
- vendor/smb-server/src/handlers/ioctl.rs (+88 lines)
- vendor/smb-server/src/proto/messages/ioctl.rs (+8 lines enum)
- vendor/smb-server/src/server.rs (+2 lines)
- vendor/smb-server/src/ntstatus.rs (+1 line)
- vendor/smb-server/src/lib.rs (+1 line)
Tests: 7 passed (smb-server), 309 passed (markbase-core)
2026-06-21 12:38:15 +08:00
Warren
5238a84972
Implement SMB Durable Handles (Phase 1): Persistent FileId + reconnect + expiration + cleanup
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
2026-06-21 05:11:39 +08:00
Warren
c3e21560b6
Implement SMB 3.x Lease support Phase 5
...
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
- WRITE handler trigger lease break (READ leases conflict with WRITE)
- READ handler trigger lease break (HANDLE leases may conflict)
- Send LeaseBreakNotification via notification channel
All 229 tests pass.
2026-06-21 01:24:59 +08:00
Warren
4620475ba8
Implement SMB 3.x Lease support Phase 4
...
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
- CLOSE handler unregister lease_key from LeaseManager
- Extract lease_key from Open struct before close
All 229 tests pass.
2026-06-21 01:24:02 +08:00
Warren
344d13435e
Implement SMB 3.x Lease support Phase 3
...
Test / build (push) Has been cancelled
Test / test (push) Has been cancelled
- CREATE handler parse RqLs create context
- Extract LeaseKey (16 bytes) + LeaseState (4 bytes)
- Check can_grant() before registration
- Register with LeaseManager
- Set Open.lease_key/lease_state fields
All 229 tests pass.
2026-06-21 01:23:32 +08:00
Warren
21a9c3c6c4
Implement SMB 3.x Lease support Phase 1-2
...
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
Phase 1: Open struct lease fields
- lease_key: Option<[u8; 16]> - LeaseKey GUID
- lease_state: Option<u32> - READ/HANDLE/WRITE flags
- lease_flags: Option<u32> - BREAKING etc.
Phase 2: LeaseManager
- LeaseEntry with lease_key/state/flags
- register/unregister/can_grant methods
- break_lease returns LeaseBreakNotification
- LeaseBreakNotification struct (MS-SMB2 §2.2.26)
ServerState: lease_manager field added
All 229 tests pass.
2026-06-21 01:20:18 +08:00
Warren
3cf503d05f
Implement Oplock Break Acknowledgement handler (MS-SMB2 §2.2.24)
...
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
- Parse client's OPLOCK_BREAK_ACK
- Update Open.oplock_level in Open struct
- Update OplockManager entry via update_oplock_level()
- Return confirmation response
All 229 tests pass.
2026-06-21 01:15:21 +08:00
Warren
063a697e83
Add READ handler oplock break (Phase 5.5)
...
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
- Trigger oplock break before read if conflicting opens exist
- Use granted_access from Open struct
- Send notifications via notification_tx channel
- Fix WRITE handler granted_access source (from Tree)
All 229 tests pass.
2026-06-21 01:13:35 +08:00
Warren
2dd50e4cb6
Implement SMB Oplocks Phase 3+5
...
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
Phase 3: NotificationQueue
- Add notification_tx to Connection struct
- Modify writer.rs to use tokio::select! for response + notification
- Add write_to_bytes() to OplockBreakNotification
- Support server→client async messages
Phase 5: WRITE Handler oplock break
- Get path/share_access before write
- Trigger OplockManager.break_oplock()
- Send OPLOCK_BREAK_NOTIFICATION to affected clients
- Encode and send via notification channel
All 229 tests pass.
2026-06-21 00:35:48 +08:00
Warren
276308af12
Implement SMB Byte-range Lock (Phase 7)
...
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
- Add LockManager to oplock.rs:
- LockRange struct for tracking byte-range locks
- acquire() - check conflicts before granting lock
- release() - remove specific lock by offset/length
- clear() - clear all locks when file closed
- ranges_overlap() - helper for conflict detection
- Add LockManager to ServerState
- Update handlers/lock.rs:
- Parse LockRequest and LockElement
- Process each lock element (acquire/release)
- Support FLAG_EXCLUSIVE_LOCK, FLAG_SHARED_LOCK, FLAG_UNLOCK
- Return STATUS_LOCK_NOT_GRANTED on conflict
- Update handlers/close.rs:
- Clear all locks when file closed
- Add STATUS_LOCK_NOT_GRANTED to ntstatus.rs
All 229 tests pass.
2026-06-21 00:25:55 +08:00
Warren
54ce0d6916
Implement SMB Oplocks Phase 4+6
...
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
Phase 4: CREATE Handler dynamic oplock granting
- Use OplockManager.can_grant() to determine oplock level
- Register OplockEntry if oplock granted
- Support ShareAccess compatibility checking
- Grant Level II if exclusive/batch oplock exists
Phase 6: CLOSE Handler oplock cleanup
- Unregister from OplockManager when file closed
- Only unregister if oplock_level > 0
All 229 tests pass.
2026-06-21 00:19:51 +08:00
Warren
27707bbe0e
Implement SMB Oplocks Phase 1-2
...
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
Phase 1: Data structures
- Add oplock_level and share_access fields to Open struct
- Update Open::new() signature with new parameters
- Update handlers/create.rs to pass oplock params
Phase 2: OplockManager
- Create oplock.rs with OplockManager struct
- OplockEntry for tracking per-client oplock state
- can_grant() - check ShareAccess compatibility
- register() / unregister() - lifecycle management
- break_oplock() - generate OPLOCK_BREAK_NOTIFICATION
- Add OplockManager to ServerState
- Add Hash trait to SmbPath for HashMap key
All 229 tests pass.
2026-06-21 00:17:24 +08:00
Warren
24029501d9
Add placeholder smb-server integration test files
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
2026-06-20 21:07:27 +08:00
Warren
7eb528d35f
SMB Server Phase 2: VFS backend build fix + integration test
...
Test / build (push) Has been cancelled
Test / test (push) Has been cancelled
- Add VfsFile: Send supertrait for Mutex compatibility
- Fix SmbServerCommand: struct → Subcommand enum with Start variant
- Fix tracing_subscriber::init() → try_init() to avoid panic when
logger already initialized
- Fix CLI subcommand name: smb-server → smb-start (flatten naming)
- Add #[command(name = "smb-start")] for CLI disambiguation
- Fix unused variable warnings (smb_fs.rs, smb_server_backend.rs)
- Remove unused VfsFile imports (webdav.rs, scp_handler.rs)
- Integration test: Docker smbclient verified (list, upload, read)
2026-06-20 19:42:29 +08:00