avahi/fruit: _device-info._tcp not propagated

Rouven WEILER Rouven_Weiler at gmx.net
Tue Jan 15 19:52:32 UTC 2019


Thanks for the patch.
I had some further thought on this…

The "fruit:model = MacSamba“ does not seem to change any icon in the finder since there is no MacSamba icon on MacOS.
This means the default will be shown which is the same as no _device-info.

So here the idea: Why not enable the _device-info only, when there is a string other than „MacSamba“.
This would decrease the change of having a device-info which is senseless…
The docs could then tell that valid fruit:model names, e.g. RackMac, MacPro, etc. could be found in
"/System/Library/CoreServices/CoreTypes.bundle/Contents/Info.plist“ on MacOS.

Here is the if-statement I was thinking of. Hope I got the strcmp right. Maybe the string.h header needs to be set.. I am no software engineer...
---
if (strcmp(lp_parm_const_string(-1,
                                         "fruit",
                                         "model",
                                         "MacSamba), "MacSamba") != 0 ) {
                        model = talloc_asprintf(state, "model=%s",
                                                lp_parm_const_string(-1,
                                                                     "fruit",
                                                                     "model",
                                                                     "MacSamba"));
                        if (model == NULL) {
                                DBG_DEBUG("out of memory\n");
                                avahi_entry_group_free(state->entry_group);
                                state->entry_group = NULL;
                                break;
                        }

                        error = avahi_entry_group_add_service(
                                    state->entry_group, AVAHI_IF_UNSPEC,
                                    AVAHI_PROTO_UNSPEC, 0, hostname,
                                    "_device-info._tcp", NULL, NULL, 0,
                                    model, NULL);
                        if (error != AVAHI_OK) {
                                DBG_DEBUG("avahi_entry_group_add_service failed: %s\n",
                                          avahi_strerror(error));
                                avahi_entry_group_free(state->entry_group);
                                state->entry_group = NULL;
                                break;
                        }
                }
---


> Am 15.01.2019 um 15:52 schrieb Ralph Böhme via samba-technical <samba-technical at lists.samba.org>:
> 
> On Tue, Jan 15, 2019 at 03:37:11PM +0100, Günther Deschner via samba-technical wrote:
>> +		const char *model;
> 
> if you NULL initialize this one: +1. Thanks! :)
> 
> -slow
> 
> -- 
> Ralph Boehme, Samba Team                https://samba.org/
> Samba Developer, SerNet GmbH   https://sernet.de/en/samba/
> GPG-Fingerprint   FAE2C6088A24252051C559E4AA1E9B7126399E46
> 




More information about the samba-technical mailing list