GNOME Bugzilla – Bug 783917
Duplicate smb servers due to avahi
Last modified: 2017-06-20 09:25:06 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 ?
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 ***
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).
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
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.
Well it's samba doing that I believe: https://anonscm.debian.org/cgit/pkg-samba/samba.git/tree/source3/smbd/avahi_register.c#n89
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
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?
(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.