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
@@ -47,16 +47,19 @@ Full UX control (login form appears in-pane), smart defaults (pre-fill username
47
47
guest/credentials toggle. Uses `security-framework` crate for Keychain access. Passwords never stored in our settings
48
48
file — only in Keychain. Linux uses `keyring` crate (Secret Service) with encrypted file fallback.
49
49
50
-
### `smb-rs` for SMB share enumeration (not `pavao`/libsmbclient or `smbutil`)
50
+
### `smb2` for SMB share enumeration (not `pavao`/libsmbclient, `smb-rs`, or `smbutil`)
51
51
52
52
MIT license (compatible with BSL, allows dual-licensing for enterprise), pure Rust (no C dependencies), async-native
53
-
(built on tokio), and cross-platform (macOS, Linux, Windows). `pavao` (libsmbclient wrapper) was rejected for its GPLv3
54
-
license. `smbutil` CLI was rejected for fragile text parsing and process spawning. Fallback to `smbutil`/`smbclient` is
55
-
available for older Samba servers where smb-rs's RPC fails.
53
+
(built on tokio), cross-platform, and typed errors (`smb2::Error` variants vs string pattern matching). David's own
54
+
crate — single dependency replaces the old `smb` + `smb-rpc` pair. `smb2::list_shares()` returns pre-filtered disk
55
+
shares with clean `String` fields (no NDR parsing needed). Fallback to `smbutil`/`smbclient` is available for older
56
+
Samba servers where smb2's RPC fails.
56
57
57
58
### Always use IP when available
58
59
59
-
smb-rs doesn't resolve `.local` hostnames reliably (std lib DNS doesn't handle mDNS). Always pass resolved IP from mDNS discovery. If IP unavailable, use derived hostname (`service_name_to_hostname`).
60
+
smb2 uses the addr host component in UNC paths (`\\server\IPC$`). When hostname has a `.local` suffix, strip it
61
+
before passing as addr (some servers reject `.local` in UNC paths). Always pass resolved IP from mDNS discovery when
62
+
available. If IP unavailable, use derived hostname with `.local` stripped.
60
63
61
64
### Guest-first auth flow
62
65
@@ -67,14 +70,14 @@ smb-rs doesn't resolve `.local` hostnames reliably (std lib DNS doesn't handle m
67
70
68
71
### smbutil / smbclient fallback
69
72
70
-
`smb` crate fails on older Samba servers (for example, Raspberry Pi) with RPC incompatibility. Classify error as `ProtocolError`, then try a platform-specific CLI fallback:
73
+
`smb2` crate may fail on older Samba servers with RPC incompatibility. Classify error as `ProtocolError`, then try a platform-specific CLI fallback:
71
74
-**macOS:**`smbutil view -G` (built-in).
72
75
-**Linux:**`smbclient -L` (from `samba-client` package). If `smbclient` is not installed, returns a `MissingDependency` error with a distro-specific install command (detected via `/etc/os-release`). The `smb_smbutil.rs` Linux stubs delegate to `smb_smbclient.rs`.
smb-rs connections are lightweight and created on-demand. Caching is at the share list level (30s TTL), not TCP connection level.
80
+
smb2 connections are lightweight (one `SmbClient` per connection) and created on-demand. Caching is at the share list level (30s TTL), not TCP connection level.
78
81
79
82
### In-memory credential cache
80
83
@@ -99,3 +102,4 @@ On Linux, `keychain_linux.rs` tries Secret Service (GNOME Keyring / KDE Wallet)
99
102
-**`ShareListError` uses internally tagged serde format** (`#[serde(tag = "type")]`) with struct variants. This keeps a flat JSON shape (`{ "type": "protocol_error", "message": "..." }`). The `MissingDependency` variant adds an optional `installCommand` field. When adding new variants, use struct syntax (not tuple).
100
103
-**macOS smbutil and NetFSMountURLSync fail with loopback IP + non-standard port**: `//127.0.0.1:9445` gives "Broken pipe", but `//localhost:9445` works. `build_smbutil_url` and `NetworkMountView.svelte` both fall back to hostname when IP is `127.0.0.1` or `::1`. This matters for E2E testing against Docker containers on localhost.
101
104
-**Mount URL must include port when non-standard**: `NetworkMountView.svelte` appends `:PORT` to the server string when `port !== 445`. Without this, `NetFSMountURLSync` defaults to port 445 and can't reach Docker containers on custom ports.
105
+
-**Strip `.local` from addr for smb2**: `smb2::Connection::connect()` extracts `server_name` from the addr string and uses it in UNC paths. Passing `"foo.local:445"` creates `\\foo.local\IPC$` which some servers reject. The `build_addr` helper in `smb_connection.rs` handles this.
0 commit comments