Bug 392447 - KIO does not use WS-discovery for SMB network resources discovery, so Dolphin shows nothing on smb:// or smb://workgroup/
Summary: KIO does not use WS-discovery for SMB network resources discovery, so Dolphin...
Status: CLOSED FIXED
Alias: None
Product: kio-extras
Classification: Frameworks and Libraries
Component: Samba (show other bugs)
Version: 23.08.4
Platform: Arch Linux Linux
: HI major
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: usability
: 388000 392803 393880 398698 399906 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-03-28 11:37 UTC by suse
Modified: 2024-01-10 19:47 UTC (History)
20 users (show)

See Also:
Latest Commit:
Version Fixed In: 20.04.0


Attachments
journalctl of samba 4.7.6 (4.00 KB, text/plain)
2018-03-28 11:40 UTC, suse
Details
Samba config file - Mario (7.94 KB, text/plain)
2024-01-02 20:19 UTC, Mario
Details
My resolution host file (809 bytes, text/plain)
2024-01-02 20:23 UTC, Mario
Details
Wsdd log (64.25 KB, text/plain)
2024-01-02 20:30 UTC, Mario
Details

Note You need to log in before you can comment on or make changes to this bug.
Description suse 2018-03-28 11:37:42 UTC
Dolphin doesn't show any samba share.
smb:// and smb://workgroup/ are empty.

However, smbtree is always working.
If made all test with deactivated firewall.

Entering a specific share like smb://twvm1/ is always working.


I've made many test with different distributions and software versions:
--------
DOES NOT WORK:

Tumbleweed with:
Plasma: 5.12.3
Framework: 5.44.0
Applications: 17.12.3
Samba: 4.7.6

Fedora 27 with
Plasma: 5.12.2
Framework: 5.44.0
Applications: 17.12.2
Samba: 4.7.6

Neon with
Plasma: 5.12.3
Framework: 5.44.0
Applications: 17.12.3
Samba 4.3.11-Ubuntu
extra file: ~/.smb/smb.conf
[global]
    client max protocol = SMB2


----------
WORKS:

Neon with
Plasma: 5.12.3
Framework: 5.44.0
Applications: 17.12.3
Samba 4.3.11-Ubuntu

Tumbleweed with:
Plasma: 5.12.3
Framework: 5.44.0
Applications: 17.12.3
Samba: 4.6.16 (Downgraded with repo home:j-engel)

Tumbleweed with:
Plasma: 5.12.3
Framework: 5.44.0
Applications: 17.12.3
Samba: 4.7.6
extra file: ~/.smb/smb.conf
[global]
    client max protocol = NT1

===============
Conclusion:
As soon as the samba protocol newer NT1 (e.g. SMB2) is used, then dolphin doesn't show the samba shares.

You can force the usage of NT1 via:
- Samba < 4.7
or adding the extra file ~/.smb/smb.conf
    [global]
        client max protocol = NT1

You can force the usage of SMB2 or SMB3 via:
- Samba >= 4.7
or adding the extra file ~/.smb/smb.conf
    [global]
        client max protocol = SMB3
Comment 1 suse 2018-03-28 11:40:01 UTC
Created attachment 111699 [details]
journalctl of samba 4.7.6

This log is from a samba 4.7.6 machine where the SMB2 or SMB3 protocol is used.
I've clicked on "samba shares" in dophin (= smb://).
Comment 2 ben van 't ende 2018-04-30 15:58:54 UTC
I added the extra file ~/.smb/smb.conf
    [global]
        client max protocol = NT1

For Kubuntu 18.04 (Samba version 4.7.6-Ubuntu)

to get it to work
Comment 3 Patrick Silva 2018-05-05 18:01:15 UTC
I can not confirm.
My two computers run Arch Linux
pc A: kde plasma 5.12.5, frameworks 5.45, dolphin 18.04, samba 4.8.1
pc B: Gnome 3.28.1, nautilus 3.28.1, samba 4.8.1

Both computers have
"[global]
    client max protocol = SMB2"
in their smb.conf file.
Dolphin from pc A shows the samba shares from pc B.
Comment 4 Patrick Silva 2018-05-06 00:32:32 UTC
*** Bug 393880 has been marked as a duplicate of this bug. ***
Comment 5 Bernd Lachner 2018-06-23 10:08:22 UTC
I can confirm this behavior with openSUSE Leap 15.0 (Plasma 5.12.5, Frameworks 5.45.0) on the client and Samba 4.6.14 on the server.

Dolphin shows nothing with smb:// if I go to the share directly in Dolphin it works. With smbtree the shares are showing correctly.

The following file on the client helps, thank you:
~/.smb/smb.conf
[global]
    client max protocol = NT1

But it would be better do solve this issue in the smb kio plugin directly.
Comment 6 Nate Graham 2018-07-20 21:06:01 UTC
*** Bug 392803 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2018-07-20 21:06:02 UTC
*** Bug 388000 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2018-07-20 21:14:38 UTC
Migrating information from a duped bug:

The SMB1 protocol is deprecated and Microsoft strongly urges people not to use it. Windows 2016 server does not support it, and Windows 10 only supports it if it's used within the first 15 days (!). It's clearly not going to work in the future. [1]

Ubuntu 18.04 ships with Samba 4.7.6, which uses SMB2 by default.

Network discovery is provided by the SMB1 protocol. [2]

In SMB2 and later, network discovery has to be provided by a separate protocol, WS-Discovery.

There doesn't seem to be any Linux support for WS-Discovery, either in the Samba project or elsewhere[3]

The Smbtree command line tool intelligently downgrades itself to using the old SMB1 version for the purposes of browsing.[4] Connections are actually made using the newer, more secure version. libsamba (the actual library that we use) does not have the same behavior.


---


Distros have been left with two bad options: stay with the insecure and deprecated SMB1 protocol to preserve the network discovery feature for many (but not all) SMB resources, or move to the secure and supported version of the SMB protocol and lose network discovery for all SMB resources. Ubuntu and OpenSUSE chose the latter.

You can make the other choice for yourself by adding "client max version = NT" to /etc/samba/smb.conf.


---


KDE's options are as follows:
1. Wait for Samba to support the newer WS-Discovery protocol for browsing
2. Implement WS-Discovery support ourselves, perhaps taking inspiration or re-using an existing approach. [5][6]


[1] https://blogs.technet.microsoft.com/filecab/2016/09/16/stop-using-smb1/
[2] https://dev.solus-project.com/T1223#91845
[3] https://dev.solus-project.com/T1223#92389
[4] https://bugzilla.samba.org/show_bug.cgi?id=12876#c2
[5] https://nmap.org/nsedoc/scripts/wsdd-discover.html
[6] http://www.dankulp.com/blog/2013/05/apache-cxf-and-ws-discovery/
Comment 9 Nate Graham 2018-09-17 14:28:30 UTC
*** Bug 398698 has been marked as a duplicate of this bug. ***
Comment 10 Nate Graham 2018-09-21 16:01:37 UTC
The GNOME folks just forced the use of SMB1/NT1 for discovery purposes in Nautilus/GVFS: https://gitlab.gnome.org/GNOME/gvfs/merge_requests/12/diffs

We might consider doing something similar until a better fix can be implemented.
Comment 11 Patrick Silva 2018-10-17 10:02:48 UTC
*** Bug 399906 has been marked as a duplicate of this bug. ***
Comment 12 Harald Sitter 2018-12-07 12:55:18 UTC
Git commit 55eb68ff63646050311f8b689752ad500246c916 by Harald Sitter.
Committed on 07/12/2018 at 12:55.
Pushed by sitter into branch 'master'.

fallback to dnssd service discovery if smb listDir failed on root

Summary:
This elevates a problem with newer SMB protocol versions and smbclient
not supporting discovery/browsing. when not using older (as in:
ancient) protocol versions discovery doesn't work and smb:/ gives no
results.

By falling back to DNSSD based discovery we can ensure discovery of DNSSD
remotes (namely linux and osx) is always working. Windows unfortunately
does not support DNSSD and as such will not benefit from this mode of
discovery and continue to be unlisted when using a protocol version
without browsing support.

CHANGELOG: When SMB Discovery is not working (protocol > SMB1) host discovery will now fall back to DNS-SD/Avahi/Bonjour.
Related: bug 390551

Test Plan:
smb.conf:

```
[global]
client min protocol = SMB2
```

Lists devices

Reviewers: #frameworks, #dolphin, broulik

Reviewed By: broulik

Subscribers: acrouthamel, alexde, bcooksley, ngraham, kde-frameworks-devel, kfm-devel

Tags: #dolphin, #frameworks

Differential Revision: https://phabricator.kde.org/D16299

M  +6    -0    CMakeLists.txt
M  +3    -0    config-runtime.h.cmake
M  +16   -3    smb/CMakeLists.txt
M  +1    -0    smb/kio_smb.h
M  +126  -3    smb/kio_smb_browse.cpp

https://commits.kde.org/kio-extras/55eb68ff63646050311f8b689752ad500246c916
Comment 13 Иван Туманов 2019-05-21 04:07:15 UTC
(In reply to Bernd Lachner from comment #5)
> I can confirm this behavior with openSUSE Leap 15.0 (Plasma 5.12.5,
> Frameworks 5.45.0) on the client and Samba 4.6.14 on the server.
> 
> Dolphin shows nothing with smb:// if I go to the share directly in Dolphin
> it works. With smbtree the shares are showing correctly.
> 
> The following file on the client helps, thank you:
> ~/.smb/smb.conf
> [global]
>     client max protocol = NT1
> 
> But it would be better do solve this issue in the smb kio plugin directly.
Comment 14 Harald Sitter 2020-02-24 14:54:45 UTC
Git commit 41397521423b8a61e35720ae156cb2e84c7c0122 by Harald Sitter.
Committed on 24/02/2020 at 14:54.
Pushed by sitter into branch 'master'.

add initial wsdiscovery support

Summary:
needs kdsoap >= 1.8.50 (current master).
builds a static variant of kdsoap-ws-discovery-client but can also
use system's version if available.

also reinvents how discovery works:
there are now Discoverers for dnssd and wsd that get started/stopped.
the Discoverers discover servers and emit them as Discoveries. Discoveries
are then converted to udsentries for kio.
FIXED-IN: 20.04.0

Test Plan:
discover all the things!

- windows 10 test vm with remote address
- https://github.com/christgau/wsdd on remote host
- avahi smb on remote host

Reviewers: dfaure, #frameworks, #dolphin, ngraham

Reviewed By: dfaure, ngraham

Subscribers: meven, schmeisser, bcooksley, ngraham, caspermeijn, davidedmundson, kde-frameworks-devel, kfm-devel

Tags: #dolphin, #frameworks

Differential Revision: https://phabricator.kde.org/D25682

M  +24   -2    smb/CMakeLists.txt
A  +31   -0    smb/discovery.cpp     [License: GPL]
A  +53   -0    smb/discovery.h     [License: GPL]
A  +118  -0    smb/dnssddiscoverer.cpp     [License: GPL]
A  +64   -0    smb/dnssddiscoverer.h     [License: GPL]
A  +1    -0    smb/kdsoap-ws-discovery-client/.gitignore
A  +17   -0    smb/kdsoap-ws-discovery-client/.gitlab-ci.yml
A  +105  -0    smb/kdsoap-ws-discovery-client/CMakeLists.txt
A  +5    -0    smb/kdsoap-ws-discovery-client/KDSoapWSDiscoveryClientConfig.cmake.in
A  +674  -0    smb/kdsoap-ws-discovery-client/LICENSE
A  +52   -0    smb/kdsoap-ws-discovery-client/README.md
A  +16   -0    smb/kdsoap-ws-discovery-client/examples/CMakeLists.txt
A  +24   -0    smb/kdsoap-ws-discovery-client/examples/onvif-discover/CMakeLists.txt
A  +32   -0    smb/kdsoap-ws-discovery-client/examples/onvif-discover/main.cpp     [License: GPL (v3+)]
A  +56   -0    smb/kdsoap-ws-discovery-client/examples/onvif-discover/onvifdiscover.cpp     [License: GPL (v3+)]
A  +43   -0    smb/kdsoap-ws-discovery-client/examples/onvif-discover/onvifdiscover.h     [License: GPL (v3+)]
A  +102  -0    smb/kdsoap-ws-discovery-client/src/CMakeLists.txt
A  +161  -0    smb/kdsoap-ws-discovery-client/src/wsdiscoveryclient.cpp     [License: GPL (v3+)]
A  +54   -0    smb/kdsoap-ws-discovery-client/src/wsdiscoveryclient.h     [License: GPL (v3+)]
A  +104  -0    smb/kdsoap-ws-discovery-client/src/wsdiscoveryprobejob.cpp     [License: GPL (v3+)]
A  +63   -0    smb/kdsoap-ws-discovery-client/src/wsdiscoveryprobejob.h     [License: GPL (v3+)]
A  +90   -0    smb/kdsoap-ws-discovery-client/src/wsdiscoverytargetservice.cpp     [License: GPL (v3+)]
A  +51   -0    smb/kdsoap-ws-discovery-client/src/wsdiscoverytargetservice.h     [License: GPL (v3+)]
A  +230  -0    smb/kdsoap-ws-discovery-client/wsdl/docs.oasis-open.org/ws-dd/discovery/1.1/os/wsdd-discovery-1.1-schema-os.xsd
A  +136  -0    smb/kdsoap-ws-discovery-client/wsdl/docs.oasis-open.org/ws-dd/discovery/1.1/os/wsdd-discovery-1.1-wsdl-os.wsdl
A  +30   -0    smb/kdsoap-ws-discovery-client/wsdl/download.sh
A  +149  -0    smb/kdsoap-ws-discovery-client/wsdl/schemas.xmlsoap.org/ws/2004/08/addressing
A  +92   -0    smb/kdsoap-ws-discovery-client/wsdl/schemas.xmlsoap.org/ws/2004/09/transfer/transfer.wsdl
A  +73   -0    smb/kdsoap-ws-discovery-client/wsdl/schemas.xmlsoap.org/ws/2004/09/transfer/transfer.xsd
A  +140  -0    smb/kdsoap-ws-discovery-client/wsdl/schemas.xmlsoap.org/ws/2005/04/discovery/ws-discovery.wsdl
A  +272  -0    smb/kdsoap-ws-discovery-client/wsdl/schemas.xmlsoap.org/ws/2005/04/discovery/ws-discovery.xsd
A  +137  -0    smb/kdsoap-ws-discovery-client/wsdl/www.w3.org/2006/03/addressing/ws-addr.xsd
M  +0    -1    smb/kio_smb.h
M  +71   -112  smb/kio_smb_browse.cpp
A  +315  -0    smb/wsdiscoverer.cpp     [License: GPL]
A  +76   -0    smb/wsdiscoverer.h     [License: GPL]

https://commits.kde.org/kio-extras/41397521423b8a61e35720ae156cb2e84c7c0122
Comment 15 Mario 2024-01-02 20:17:38 UTC Comment hidden (spam)
Comment 16 Mario 2024-01-02 20:19:13 UTC Comment hidden (spam)
Comment 17 Mario 2024-01-02 20:23:06 UTC Comment hidden (spam)
Comment 18 Mario 2024-01-02 20:30:44 UTC Comment hidden (spam)
Comment 19 Nate Graham 2024-01-10 19:47:48 UTC Comment hidden (spam)