Skip to content

Serve the snapshot share through smbanything_core - #87

Merged
andrewchen5678 merged 3 commits into
mainfrom
use-smbanything-core
Sep 1, 2026
Merged

andrewchen5678 merged 3 commits into
mainfrom
use-smbanything-core

Conversation

@andrewchen5678

Copy link
Copy Markdown
Contributor

The SMB 2.1 server was extracted into the smbanything project's smbanything_core crate and improved there (review fixes wrustic's copy never got: the srvsvc CLOSE body size, overflow-checked signing extents, a bounded NBSS length, a body-read timeout, IPv6-loopback fallback). wrustic now depends on that crate — pinned by rev, via andrewtheguy/smbanything#9 — instead of carrying its own diverged copy of the protocol code: −11,278 lines.

What remains in src/smb/ is the restic side:

  • backing.rs — SnapshotBacking/NestedBacking over rustic_core, wire_safe
  • name.rs — restic's filename quoting, unchanged
  • mod.rs — start_snapshot_share, and a SmbHandle that wraps the crate's server handle together with the repository lock (field order = drop order: server stops before the lock releases)

Other changes:

  • --smb-tun maps to the crate's tun feature; TunAddrs parsing/validation comes from the crate (cli.rs keeps only the flag-name error prefix)
  • the vendored Wintun DLL is now pinned by a test against the digest smbanything_core will accept at load time, replacing the deleted in-tree pin test
  • local_server comes from the crate too (with its newer IPv6-fallback behavior)
  • WRUSTIC_SMB_LOG still works — start_snapshot_share forwards it to the crate's enable_log
  • protocol docs moved to smbanything; docs/smb.md/docs/smb-tun.md keep the wrustic-specific halves and link over

One inherited behavior change: the share is now case-insensitive on lookup (the crate hashes lowercased path components for file ids and no longer advertises FILE_CASE_SENSITIVE_SEARCH), matching what SMB clients assume.

Verified: cargo clippy --all-features --all-targets -- -D warnings and cargo test --all-features clean on Linux, including the live smbclient walk of a nested share.

🤖 Generated with Claude Code

The SMB 2.1 server was extracted into the smbanything project's
smbanything_core crate and improved there; wrustic now depends on that crate
instead of carrying its own copy of the protocol code. What remains in
src/smb/ is the restic side: SnapshotBacking, the filename-quoting decoder,
and start_snapshot_share, whose handle now wraps the crate's server handle
together with the repository lock. The tun transport comes from the crate's
`tun` feature, the vendored Wintun DLL is pinned against the digest the crate
will accept, and the protocol docs move to smbanything with the code.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Andrew Chen and others added 2 commits September 1, 2026 07:12
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@andrewchen5678
andrewchen5678 merged commit b0492df into main Sep 1, 2026
2 of 3 checks passed
@andrewchen5678 andrewchen5678 mentioned this pull request Sep 1, 2026
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.

1 participant