Skip to content

Add compound requests and ReaddirPlus for batched security descriptor queries#42

Merged
rakitzis merged 6 commits intomainfrom
compound_acls
Mar 16, 2026
Merged

Add compound requests and ReaddirPlus for batched security descriptor queries#42
rakitzis merged 6 commits intomainfrom
compound_acls

Conversation

@rakitzis
Copy link
Copy Markdown
Collaborator

Introduces SMB2 compound request support (CREATE+QUERY_INFO+CLOSE triplets batched into single round-trips) and exposes it via File.ReaddirPlus and Share.ReadDirPlus, which enrich directory listings with security descriptors while respecting credit limits through automatic sub-batching.

Tested with a container running samba and running the integration tests:

=== RUN   TestReaddir
--- PASS: TestReaddir (0.01s)
=== RUN   TestReaddirPlus
=== RUN   TestReaddirPlus/File.ReaddirPlus_all
=== RUN   TestReaddirPlus/File.ReaddirPlus_incremental
=== RUN   TestReaddirPlus/Share.ReadDirPlus
=== RUN   TestReaddirPlus/empty_directory
--- PASS: TestReaddirPlus (0.03s)
    --- PASS: TestReaddirPlus/File.ReaddirPlus_all (0.00s)
    --- PASS: TestReaddirPlus/File.ReaddirPlus_incremental (0.00s)
    --- PASS: TestReaddirPlus/Share.ReadDirPlus (0.00s)
    --- PASS: TestReaddirPlus/empty_directory (0.00s)
PASS

Comment thread tree_conn.go Outdated
Comment thread tree_conn.go Outdated
Comment thread tree_conn.go Outdated
Comment thread tree_conn.go Outdated
Comment thread tree_conn.go
Comment thread tree_conn.go
Comment thread client.go
@arashpayan
Copy link
Copy Markdown
Collaborator

It's an impressive but complex PR, so it took me awhile to get through reviewing it in detail.

… queries

Introduces SMB2 compound request support (CREATE+QUERY_INFO+CLOSE triplets
batched into single round-trips) and exposes it via File.ReaddirPlus and
Share.ReadDirPlus, which enrich directory listings with security descriptors
while respecting credit limits through automatic sub-batching.
The previous calculation with uint16s would overflow at
21845 directory entries. Use ints instead and clamp later.
@rakitzis rakitzis merged commit fe840aa into main Mar 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants