gvfsd-smb-browse can't mount folders shared from window 10
This issue is reproducible on both Debian stable and testing, gvfs-backends version:
- testing: 1.53.90-2
- stable: 1.50.3
Maybe because of Web Services Discovery is not implemented in libsmbclient, so gvfs can't resolve the address of server, according to the following code, which will make gvfsd-smb-browse forces protocol to NT1 i.e. SMBv1, which is not supported anymore by window 10, windows 10 will reset the connection during negotiation(verified through wireshark).
A quick dirty fix by modifying the binary is:
-
vim -b /usr/libexec/gvfsd-smb-browse
, replace all NT1 as NT0, which makes the set protocol fail - kill pid of /usr/libexec/gvfsd-smb-browse
- mount in nautilus or
gio mount smb://win10-pc
will then work fine
daemon/gvfsbackendsmbbrowse.c#L725
#ifdef HAVE_SMBC_SETOPTIONPROTOCOLS
/* Force NT1 protocol version if server can't be resolved (i.e. is not
* hostname, nor IP address). This is needed for workgroup support, because
* "client max protocol" has been changed from NT1 to SMB3 in recent samba
* versions.
*/
if (op_backend->server != NULL)
{
GResolver *resolver;
GList *addresses;
GError *error = NULL;
gchar *server;
resolver = g_resolver_get_default ();
/* IPv6 server includes brackets in GMountSpec, GResolver doesn't */
if (gvfs_is_ipv6 (op_backend->server))
server = g_strndup (op_backend->server + 1, strlen (op_backend->server) - 2);
else
server = g_strdup (op_backend->server);
addresses = g_resolver_lookup_by_name (resolver, server, NULL, &error);
if (addresses == NULL)
{
if (error != NULL)
{
g_debug ("%s\n", error->message);
g_error_free (error);
}
g_debug ("Forcing NT1 protocol version\n");
smbc_setOptionProtocols (smb_context, "NT1", "NT1");
}
g_resolver_free_addresses (addresses);
g_object_unref (resolver);
g_free (server);
}
#endif
PS. gvfs connection to linux samba server 4.17.12 will also fail if not set client min protocol to CORE in server's smb.conf, since gvfs fallbacks protocol to NT1 too, tested on debian stable.
Edited by bob bob