SMB Server Phase 2: VFS backend build fix + integration test
Some checks failed
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)
This commit is contained in:
Warren
2026-06-20 19:42:29 +08:00
parent 45d050c0b3
commit 7eb528d35f
167 changed files with 59897 additions and 12 deletions

View File

@@ -0,0 +1,27 @@
//! OPLOCK_BREAK handler — acknowledge breaks without granting oplocks.
use std::sync::Arc;
use crate::proto::header::Smb2Header;
use crate::proto::messages::FileId;
use crate::conn::state::Connection;
use crate::dispatch::HandlerResponse;
use crate::server::ServerState;
pub async fn handle(
_server: &Arc<ServerState>,
_conn: &Arc<Connection>,
_hdr: &Smb2Header,
_body: &[u8],
) -> HandlerResponse {
// Echo back the same shape as the notification — structure_size=24, level=0.
let mut buf = Vec::new();
buf.extend_from_slice(&24u16.to_le_bytes()); // structure_size
buf.push(0); // OplockLevel
buf.push(0); // Reserved
buf.extend_from_slice(&0u32.to_le_bytes()); // Reserved2
buf.extend_from_slice(&FileId::any().persistent.to_le_bytes());
buf.extend_from_slice(&FileId::any().volatile.to_le_bytes());
HandlerResponse::ok(buf)
}