After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 783917 - Duplicate smb servers due to avahi
Duplicate smb servers due to avahi
Status: RESOLVED DUPLICATE of bug 700794
Product: gvfs
Classification: Core
Component: smb backend
1.30.x
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2017-06-18 10:26 UTC by Laurent Bigonville
Modified: 2017-06-20 09:25 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Laurent Bigonville 2017-06-18 10:26:45 UTC
Hi,

If a SMB server is also publishing its presence using avahi, the server are shown twice in nautilus. Both are using the netbios name so they cannot be differenced.

If I'm opening a share on the two servers, they are definitely considered as different by gvfs as they appear twice in the fuse.gvfsd-fuse filesystem:

Example:

drwx------.  1 bigon bigon   0 mar  8 21:31 smb-share:server=diskstation.local,share=old
drwx------.  1 bigon bigon   0 mar  8 21:31 smb-share:server=diskstation,share=old

Shouldn't in this case diskstation.local and diskstation considered the same by gvfs gvfsd-smb-browse ?
Comment 1 Ondrej Holy 2017-06-19 12:30:27 UTC
Thanks for your bug report. This is more or less a duplicate of Bug 700794.

One problem is that you see the same share twice in Nautilus. See workaround [1] which might help to differenced the shares...

Another problem is that the "same" share can be mounted twice. I am not sure that we can somehow easily compare the different uris somehow (diskstation.local vs diskstation). Not sure it is safe to always remove the .local suffix... Alexander?

[1] https://bugzilla.gnome.org/show_bug.cgi?id=700794#c38

*** This bug has been marked as a duplicate of bug 700794 ***
Comment 2 Alexander Bokovoy 2017-06-19 12:45:37 UTC
Technically these are two different DNS names because avahi is not publishing NetBIOS names. Due to the ways how smb record is defined for DNS-SD, there is no way to add more details:

https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=smb (see "Defined TXT keys" note).
Comment 3 Laurent Bigonville 2017-06-19 21:21:36 UTC
The NetBios name seems to be the name of the service:


Service Type: _smb._tcp
Service Name: DISKSTATION
Domain Name: local
Interface: wlp3s0 IPv4
Address: DiskStation.local/192.168.1.25:445
TXT Data: empty


$ gvfs-ls -a "standard::*" network:///
dnssd-domain-DISKSTATION._smb._tcp	0	(shortcut)	standard::is-virtual=TRUE standard::display-name=DISKSTATION (Partage de fichiers) standard::icon=GThemedIcon:0x7fc06800b380 standard::target-uri=smb://DiskStation.local:445/ standard::symbolic-icon=GThemedIcon:0x7fc06800b260
dnssd-domain-DiskStation._webdav._tcp	0	(shortcut)	standard::is-virtual=TRUE standard::display-name=DiskStation (dav+sd) standard::icon=GThemedIcon:0x7fc06800b070 standard::target-uri=dav+sd://DiskStation._webdav._tcp.local standard::symbolic-icon=GThemedIcon:0x7fc06800b100
dnssd-domain-DiskStation._webdavs._tcp	0	(shortcut)	standard::is-virtual=TRUE standard::display-name=DiskStation (davs+sd) standard::icon=GThemedIcon:0x7fc06800b320 standard::target-uri=davs+sd://DiskStation._webdavs._tcp.local standard::symbolic-icon=GThemedIcon:0x7fc068009380
smb-root	0	(shortcut)	standard::is-virtual=TRUE standard::display-name=Réseau Windows standard::icon=GThemedIcon:0x7fc0680070f0 standard::target-uri=smb:/// standard::symbolic-icon=GThemedIcon:0x7fc068008390
smb-server-DISKSTATION	0	(shortcut)	standard::is-virtual=TRUE standard::display-name=DISKSTATION (Partage de fichiers) standard::icon=GThemedIcon:0x7fc068005060 standard::target-uri=smb://DISKSTATION/ standard::symbolic-icon=GThemedIcon:0x7fc068007150
Comment 4 Bastien Nocera 2017-06-19 21:32:22 UTC
They're the same because that's how Synology sets up those services.

There's nothing that says the NetBios name should be the same as the Service's name. Or that the Service name should be the same as the hostname.
Comment 5 Laurent Bigonville 2017-06-19 23:55:49 UTC
Well it's samba doing that I believe:

https://anonscm.debian.org/cgit/pkg-samba/samba.git/tree/source3/smbd/avahi_register.c#n89
Comment 6 Alexander Bokovoy 2017-06-20 00:42:00 UTC
Well, you do see two different sources for these entries, one coming from Avahi registration done by Samba, another one is GVFS backend 'browsable'.

This one comes from Samba doing Avahi registration if you enabled it. dnssd-domain-* is added to list of mountable by the gvfs DNS-SD backend based on what DNS-SD backend discovers from what Avahi published:

dnssd-domain-DISKSTATION._smb._tcp	0	(shortcut)	standard::is-virtual=TRUE standard::display-name=DISKSTATION (Partage de fichiers) standard::icon=GThemedIcon:0x7fc06800b380 standard::target-uri=smb://DiskStation.local:445/ standard::symbolic-icon=GThemedIcon:0x7fc06800b260

This one comes from gvfsd-smb-browse backend which adds this entry to a browsable

smb-server-DISKSTATION	0	(shortcut)	standard::is-virtual=TRUE standard::display-name=DISKSTATION (Partage de fichiers) standard::icon=GThemedIcon:0x7fc068005060 standard::target-uri=smb://DISKSTATION/ standard::symbolic-icon=GThemedIcon:0x7fc068007150
Comment 7 Laurent Bigonville 2017-06-20 08:57:48 UTC
Sure, but my point was that this is not the "synology way" it's the samba way. And if the user is not doing weird things to publish the name of the share using avahi, the name of the dns-sd service will be the netbios name. So filtering can be done at that level and it will work in 99% of the cases isn't it?

Or did I really miss something?
Comment 8 Bastien Nocera 2017-06-20 09:25:06 UTC
(In reply to Laurent Bigonville from comment #7)
> Sure, but my point was that this is not the "synology way" it's the samba
> way. And if the user is not doing weird things to publish the name of the
> share using avahi, the name of the dns-sd service will be the netbios name.
> So filtering can be done at that level and it will work in 99% of the cases
> isn't it?
> 
> Or did I really miss something?

The problem is that you really don't want to have false positives when eliminating servers from the list. Unless you can ensure that, the minor niggle of having 2 icons instead of one will likely stay.