You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: implement Close, Read, and QueryInfo handlers for E2E file read
Add the server-side handlers needed for a complete file read flow:
Create → QueryInfo → Read → Close.
Protocol types:
- Add accessor methods to SMBCloseRequest, SMBReadRequest, SMBQueryInfoRequest
- Add constructors for SMBCloseResponse, SMBReadResponse, SMBQueryInfoResponse
- Make close::flags and query_info::info_type modules public
Trait extensions:
- Add read_data() to ResourceHandle trait with implementations for
SMBFileSystemHandle (seeks + reads) and SMBIPCHandle (stub)
- Add read_data() to Open trait, delegating to the underlying handle
- Add open_table_mut() to Session trait for close cleanup
- Add remove_open() to Server trait for global open table cleanup
- Fix SMBOpen::inner() todo!() → return None (terminal handler)
Handlers (tree_connect.rs):
- handle_close: returns file metadata if POSTQUERY_ATTRIB flag set,
removes open from server (outer) then session (inner) tables
- handle_read: reads data from the open's underlying handle, enforces
minimum_count, returns SMBReadResponse
- handle_query_info: supports FileBasicInformation (class 4),
FileStandardInformation (class 5), FileNetworkOpenInformation (class 34)
per MS-FSCC; returns InvalidInfoClass for unsupported types
- Fix lock ordering in handle_create: server write before session write
Lock ordering: all handlers acquire locks outer→inner
(server → connection → session → open), readers before writers.
NTStatus: add FileClosed, EndOfFile, InvalidInfoClass, InvalidDeviceRequest
Tests:
- 13 unit tests for request accessor and response constructor round-trips
- 3 integration tests (smbclient E2E: file read, dir listing, missing file)
0 commit comments