vfs_fruit: Time Machine/FULLSYNC: add mDNS/DNS-SD advertisement

Omri Mor omri50 at gmail.com
Tue Jul 18 04:42:36 UTC 2017

Currently, users of the FULLSYNC (Time Machine) patch manually create an Avahi service file to advertise Time Machine volumes (see the GitHub PR discussions for various examples). Since Samba already contains built-in support for mDNS/DNS-SD (via Avahi or dns_sd, depending on platform), it makes sense to allow the vfs_fruit module to advertise `_adisk._tcp` in addition to `_smb._tcp`.
For Avahi, I believe that this entails somehow adding a service a service to the service group in `avahi_client_callback()`. dns_sd does not seem to have the same concept of a group: `DNSServiceRegister()` is used directly.

In either case, it’s probably best of the actual service registration code remains in `avahi_register.c` and `dnsregister.c`, respectively. This means that some method of passing additional service information to the actual registration code is necessary.
This should probably take the form of a list of service definitions that can be appended to. The registration code would parse the list and register every service therein.

259e1706e3206b215e136ea9d5beef4c9e3fcdee added the `fruit:model` option. This allows also registering a `_device-info._tcp` service with the same model name, though I’m not sure what the effect would be if the two were different (i.e. which one Finder would prioritize).

`fruit:Time Machine` appears to currently be bugged by working only when set globally. Since `_adisk._tcp` defines TXT records that determine which shares are valid Time Machine destinations, this should be fixed to allow it to be set on a per-share basis, or otherwise reverted to `fruit:fullsync` for FULLSYNC extension support and using `fruit:Time Machine` for mDNS/DNS-SD service registration.

Pointers on how to best go about integrating the FULLSYNC patch with Avahi/dns_sd would be appreciated—I am new to the Samba codebase, but would love to contribute.
Many thanks!
Omri Mor

More information about the samba-technical mailing list