X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-daemon%2Fdbus-protocol.c;h=ce2152179525729973add5aa6de334cc01f6065a;hb=feae35a24a8d234ae5a4eb629cd09c905f74dc04;hp=e5b099883474bac19573ccab28f7d86ba7cbc22a;hpb=d02bd928460b58fa2bdcce71ee01783a13d3a706;p=catta diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c index e5b0998..ce21521 100644 --- a/avahi-daemon/dbus-protocol.c +++ b/avahi-daemon/dbus-protocol.c @@ -430,7 +430,7 @@ static DBusHandlerResult respond_error(DBusConnection *c, DBusMessage *m, int er if (!text) text = avahi_strerror(error); - reply = dbus_message_new_error(m, avahi_error_number_to_dbus (error), text); + reply = dbus_message_new_error(m, avahi_error_number_to_dbus(error), text); dbus_connection_send(c, reply, NULL); dbus_message_unref(reply); @@ -504,6 +504,17 @@ static DBusHandlerResult respond_path(DBusConnection *c, DBusMessage *m, const c return DBUS_HANDLER_RESULT_HANDLED; } +static void append_server_error(DBusMessage *reply) { + const char *t; + + t = avahi_error_number_to_dbus(avahi_server_errno(avahi_server)); + + dbus_message_append_args( + reply, + DBUS_TYPE_STRING, &t, + DBUS_TYPE_INVALID); +} + static char *file_get_contents(char *fname) { int fd = -1; struct stat st; @@ -560,7 +571,6 @@ static const char *map_browse_signal_name(AvahiBrowserEvent e) { case AVAHI_BROWSER_NEW : return "ItemNew"; case AVAHI_BROWSER_REMOVE : return "ItemRemove"; case AVAHI_BROWSER_FAILURE : return "Failure"; - case AVAHI_BROWSER_NOT_FOUND : return "NotFound"; case AVAHI_BROWSER_CACHE_EXHAUSTED : return "CacheExhausted"; case AVAHI_BROWSER_ALL_FOR_NOW : return "AllForNow"; } @@ -571,25 +581,12 @@ static const char *map_browse_signal_name(AvahiBrowserEvent e) { static const char *map_resolve_signal_name(AvahiResolverEvent e) { switch (e) { case AVAHI_RESOLVER_FOUND : return "Found"; - case AVAHI_RESOLVER_TIMEOUT : return "Timeout"; case AVAHI_RESOLVER_FAILURE : return "Failure"; - case AVAHI_RESOLVER_NOT_FOUND : return "NotFound"; } abort(); } -static int map_resolve_error(AvahiResolverEvent e) { - - switch(e) { - case AVAHI_RESOLVER_FOUND : abort(); - case AVAHI_RESOLVER_TIMEOUT : return AVAHI_ERR_TIMEOUT; - case AVAHI_RESOLVER_FAILURE : return AVAHI_ERR_FAILURE; - case AVAHI_RESOLVER_NOT_FOUND : return AVAHI_ERR_NOT_FOUND; - } - - abort(); -} static DBusHandlerResult handle_introspect(DBusConnection *c, DBusMessage *m, const char *fname) { char *path, *contents; @@ -786,6 +783,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m, } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddService")) { int32_t interface, protocol; + uint32_t flags; char *type, *name, *domain, *host; uint16_t port; AvahiStringList *strlst; @@ -796,6 +794,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m, m, &error, DBUS_TYPE_INT32, &interface, DBUS_TYPE_INT32, &protocol, + DBUS_TYPE_UINT32, &flags, DBUS_TYPE_STRING, &name, DBUS_TYPE_STRING, &type, DBUS_TYPE_STRING, &domain, @@ -808,7 +807,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m, dbus_message_iter_init(m, &iter); - for (j = 0; j < 7; j++) + for (j = 0; j < 8; j++) dbus_message_iter_next(&iter); if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY || @@ -854,18 +853,54 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m, if (host && !*host) host = NULL; - if (avahi_server_add_service_strlst(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, name, type, domain, host, port, strlst) < 0) { + if (avahi_server_add_service_strlst(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, (AvahiPublishFlags) flags, name, type, domain, host, port, strlst) < 0) { avahi_string_list_free(strlst); return respond_error(c, m, avahi_server_errno(avahi_server), NULL); - } else - i->n_entries ++; - + } + + i->n_entries ++; avahi_string_list_free(strlst); return respond_ok(c, m); + } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddServiceSubtype")) { + + int32_t interface, protocol; + uint32_t flags; + char *type, *name, *domain, *subtype; + + if (!dbus_message_get_args( + m, &error, + DBUS_TYPE_INT32, &interface, + DBUS_TYPE_INT32, &protocol, + DBUS_TYPE_UINT32, &flags, + DBUS_TYPE_STRING, &name, + DBUS_TYPE_STRING, &type, + DBUS_TYPE_STRING, &domain, + DBUS_TYPE_STRING, &subtype, + DBUS_TYPE_INVALID) || !type || !name || !subtype) { + avahi_log_warn("Error parsing EntryGroup::AddServiceSubtype message"); + goto fail; + } + + if (i->n_entries >= MAX_ENTRIES_PER_ENTRY_GROUP) { + avahi_log_warn("Too many entries per entry group, client request failed."); + return respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL); + } + + if (domain && !*domain) + domain = NULL; + + if (avahi_server_add_service_subtype(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, (AvahiPublishFlags) flags, name, type, domain, subtype) < 0) + return respond_error(c, m, avahi_server_errno(avahi_server), NULL); + + i->n_entries ++; + + return respond_ok(c, m); + } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddAddress")) { int32_t interface, protocol; + uint32_t flags; char *name, *address; AvahiAddress a; @@ -873,6 +908,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m, m, &error, DBUS_TYPE_INT32, &interface, DBUS_TYPE_INT32, &protocol, + DBUS_TYPE_UINT32, &flags, DBUS_TYPE_STRING, &name, DBUS_TYPE_STRING, &address, DBUS_TYPE_INVALID) || !name || !address) { @@ -889,13 +925,13 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m, return respond_error(c, m, AVAHI_ERR_INVALID_ADDRESS, NULL); } - if (avahi_server_add_address(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, 0, name, &a) < 0) + if (avahi_server_add_address(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, (AvahiPublishFlags) flags, name, &a) < 0) return respond_error(c, m, avahi_server_errno(avahi_server), NULL); - else - i->n_entries ++; + + i->n_entries ++; return respond_ok(c, m); - } + } avahi_log_warn("Missed message %s::%s()", dbus_message_get_interface(m), dbus_message_get_member(m)); @@ -915,7 +951,8 @@ static void sync_host_name_resolver_callback(AvahiSHostNameResolver *r, AvahiIfI if (event == AVAHI_RESOLVER_FOUND) { char t[256], *pt = t; - int32_t i_interface, i_protocol, i_aprotocol, i_flags; + int32_t i_interface, i_protocol, i_aprotocol; + uint32_t u_flags; DBusMessage *reply; assert(a); @@ -924,7 +961,7 @@ static void sync_host_name_resolver_callback(AvahiSHostNameResolver *r, AvahiIfI i_interface = (int32_t) interface; i_protocol = (int32_t) protocol; i_aprotocol = (int32_t) a->proto; - i_flags = (int32_t) flags; + u_flags = (uint32_t) flags; reply = dbus_message_new_method_return(i->message); dbus_message_append_args( @@ -934,13 +971,15 @@ static void sync_host_name_resolver_callback(AvahiSHostNameResolver *r, AvahiIfI DBUS_TYPE_STRING, &host_name, DBUS_TYPE_INT32, &i_aprotocol, DBUS_TYPE_STRING, &pt, - DBUS_TYPE_INT32, &i_flags, + DBUS_TYPE_UINT32, &u_flags, DBUS_TYPE_INVALID); dbus_connection_send(server->bus, reply, NULL); dbus_message_unref(reply); - } else - respond_error(server->bus, i->message, map_resolve_error(event), NULL); + } else { + assert(event == AVAHI_RESOLVER_FAILURE); + respond_error(server->bus, i->message, avahi_server_errno(avahi_server), NULL); + } sync_host_name_resolver_free(i); } @@ -954,7 +993,8 @@ static void sync_address_resolver_callback(AvahiSAddressResolver *r, AvahiIfInde if (event == AVAHI_RESOLVER_FOUND) { char t[256], *pt = t; - int32_t i_interface, i_protocol, i_aprotocol, i_flags; + int32_t i_interface, i_protocol, i_aprotocol; + uint32_t u_flags; DBusMessage *reply; assert(host_name); @@ -963,7 +1003,7 @@ static void sync_address_resolver_callback(AvahiSAddressResolver *r, AvahiIfInde i_interface = (int32_t) interface; i_protocol = (int32_t) protocol; i_aprotocol = (int32_t) address->proto; - i_flags = (int32_t) flags; + u_flags = (uint32_t) flags; reply = dbus_message_new_method_return(i->message); dbus_message_append_args( @@ -973,13 +1013,15 @@ static void sync_address_resolver_callback(AvahiSAddressResolver *r, AvahiIfInde DBUS_TYPE_INT32, &i_aprotocol, DBUS_TYPE_STRING, &pt, DBUS_TYPE_STRING, &host_name, - DBUS_TYPE_INT32, &i_flags, + DBUS_TYPE_UINT32, &u_flags, DBUS_TYPE_INVALID); dbus_connection_send(server->bus, reply, NULL); dbus_message_unref(reply); - } else - respond_error(server->bus, i->message, map_resolve_error(event), NULL); + } else { + assert(event == AVAHI_RESOLVER_FAILURE); + respond_error(server->bus, i->message, avahi_server_errno(avahi_server), NULL); + } sync_address_resolver_free(i); } @@ -1031,14 +1073,15 @@ fail: static void domain_browser_callback(AvahiSDomainBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *domain, AvahiLookupResultFlags flags, void* userdata) { DomainBrowserInfo *i = userdata; DBusMessage *m; - int32_t i_interface, i_protocol, i_flags; + int32_t i_interface, i_protocol; + uint32_t u_flags; assert(b); assert(i); i_interface = (int32_t) interface; i_protocol = (int32_t) protocol; - i_flags = (int32_t) flags; + u_flags = (uint32_t) flags; m = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_DOMAIN_BROWSER, map_browse_signal_name(event)); @@ -1049,9 +1092,10 @@ static void domain_browser_callback(AvahiSDomainBrowser *b, AvahiIfIndex interfa DBUS_TYPE_INT32, &i_interface, DBUS_TYPE_INT32, &i_protocol, DBUS_TYPE_STRING, &domain, - DBUS_TYPE_INT32, &i_flags, + DBUS_TYPE_UINT32, &u_flags, DBUS_TYPE_INVALID); - } + } else if (event == AVAHI_BROWSER_FAILURE) + append_server_error(m); dbus_message_set_destination(m, i->client->name); dbus_connection_send(server->bus, m, NULL); @@ -1105,14 +1149,15 @@ fail: static void service_type_browser_callback(AvahiSServiceTypeBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *type, const char *domain, AvahiLookupResultFlags flags, void* userdata) { ServiceTypeBrowserInfo *i = userdata; DBusMessage *m; - int32_t i_interface, i_protocol, i_flags; + int32_t i_interface, i_protocol; + uint32_t u_flags; assert(b); assert(i); i_interface = (int32_t) interface; i_protocol = (int32_t) protocol; - i_flags = (int32_t) flags; + u_flags = (uint32_t) flags; m = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_SERVICE_TYPE_BROWSER, map_browse_signal_name(event)); @@ -1125,9 +1170,10 @@ static void service_type_browser_callback(AvahiSServiceTypeBrowser *b, AvahiIfIn DBUS_TYPE_INT32, &i_protocol, DBUS_TYPE_STRING, &type, DBUS_TYPE_STRING, &domain, - DBUS_TYPE_INT32, &i_flags, + DBUS_TYPE_UINT32, &u_flags, DBUS_TYPE_INVALID); - } + } else if (event == AVAHI_BROWSER_FAILURE) + append_server_error(m); dbus_message_set_destination(m, i->client->name); dbus_connection_send(server->bus, m, NULL); @@ -1181,14 +1227,15 @@ fail: static void service_browser_callback(AvahiSServiceBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *name, const char *type, const char *domain, AvahiLookupResultFlags flags, void* userdata) { ServiceBrowserInfo *i = userdata; DBusMessage *m; - int32_t i_interface, i_protocol, i_flags; + int32_t i_interface, i_protocol; + uint32_t u_flags; assert(b); assert(i); i_interface = (int32_t) interface; i_protocol = (int32_t) protocol; - i_flags = (int32_t) flags; + u_flags = (uint32_t) flags; m = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_SERVICE_BROWSER, map_browse_signal_name(event)); @@ -1204,9 +1251,10 @@ static void service_browser_callback(AvahiSServiceBrowser *b, AvahiIfIndex inter DBUS_TYPE_STRING, &name, DBUS_TYPE_STRING, &type, DBUS_TYPE_STRING, &domain, - DBUS_TYPE_INT32, &i_flags, + DBUS_TYPE_UINT32, &u_flags, DBUS_TYPE_INVALID); - } + } else if (event == AVAHI_BROWSER_FAILURE) + append_server_error(m); dbus_message_set_destination(m, i->client->name); dbus_connection_send(server->bus, m, NULL); @@ -1256,7 +1304,8 @@ static void sync_service_resolver_callback( if (event == AVAHI_RESOLVER_FOUND) { char t[256], *pt = t; - int32_t i_interface, i_protocol, i_aprotocol, i_flags; + int32_t i_interface, i_protocol, i_aprotocol; + uint32_t u_flags; DBusMessage *reply; assert(host_name); @@ -1270,7 +1319,7 @@ static void sync_service_resolver_callback( i_interface = (int32_t) interface; i_protocol = (int32_t) protocol; i_aprotocol = (int32_t) a->proto; - i_flags = (int32_t) flags; + u_flags = (uint32_t) flags; reply = dbus_message_new_method_return(i->message); dbus_message_append_args( @@ -1290,13 +1339,17 @@ static void sync_service_resolver_callback( dbus_message_append_args( reply, - DBUS_TYPE_INT32, &i_flags, + DBUS_TYPE_UINT32, &u_flags, DBUS_TYPE_INVALID); dbus_connection_send(server->bus, reply, NULL); dbus_message_unref(reply); - } else - respond_error(server->bus, i->message, map_resolve_error(event), NULL); + + } else { + assert(event == AVAHI_RESOLVER_FAILURE); + + respond_error(server->bus, i->message, avahi_server_errno(avahi_server), NULL); + } sync_service_resolver_free(i); } @@ -1308,11 +1361,12 @@ static void async_address_resolver_callback(AvahiSAddressResolver *r, AvahiIfInd assert(r); assert(i); - reply = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_ADDRESS_RESOLVER, map_browse_signal_name(event)); + reply = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_ADDRESS_RESOLVER, map_resolve_signal_name(event)); if (event == AVAHI_RESOLVER_FOUND) { char t[256], *pt = t; - int32_t i_interface, i_protocol, i_aprotocol, i_flags; + int32_t i_interface, i_protocol, i_aprotocol; + uint32_t u_flags; assert(address); assert(host_name); @@ -1321,7 +1375,7 @@ static void async_address_resolver_callback(AvahiSAddressResolver *r, AvahiIfInd i_interface = (int32_t) interface; i_protocol = (int32_t) protocol; i_aprotocol = (int32_t) address->proto; - i_flags = (int32_t) flags; + u_flags = (uint32_t) flags; dbus_message_append_args( reply, @@ -1330,9 +1384,12 @@ static void async_address_resolver_callback(AvahiSAddressResolver *r, AvahiIfInd DBUS_TYPE_INT32, &i_aprotocol, DBUS_TYPE_STRING, &pt, DBUS_TYPE_STRING, &host_name, - DBUS_TYPE_INT32, &i_flags, + DBUS_TYPE_UINT32, &u_flags, DBUS_TYPE_INVALID); + } else { + assert(event == AVAHI_RESOLVER_FAILURE); + append_server_error(reply); } dbus_message_set_destination(reply, i->client->name); @@ -1395,7 +1452,8 @@ static void async_host_name_resolver_callback(AvahiSHostNameResolver *r, AvahiIf if (event == AVAHI_RESOLVER_FOUND) { char t[256], *pt = t; - int32_t i_interface, i_protocol, i_aprotocol, i_flags; + int32_t i_interface, i_protocol, i_aprotocol; + uint32_t u_flags; assert(a); assert(host_name); @@ -1404,7 +1462,7 @@ static void async_host_name_resolver_callback(AvahiSHostNameResolver *r, AvahiIf i_interface = (int32_t) interface; i_protocol = (int32_t) protocol; i_aprotocol = (int32_t) a->proto; - i_flags = (int32_t) flags; + u_flags = (uint32_t) flags; dbus_message_append_args( reply, @@ -1413,8 +1471,11 @@ static void async_host_name_resolver_callback(AvahiSHostNameResolver *r, AvahiIf DBUS_TYPE_STRING, &host_name, DBUS_TYPE_INT32, &i_aprotocol, DBUS_TYPE_STRING, &pt, - DBUS_TYPE_INT32, &i_flags, + DBUS_TYPE_UINT32, &u_flags, DBUS_TYPE_INVALID); + } else { + assert(event == AVAHI_RESOLVER_FAILURE); + append_server_error(reply); } dbus_message_set_destination(reply, i->client->name); @@ -1490,22 +1551,28 @@ static void async_service_resolver_callback( if (event == AVAHI_RESOLVER_FOUND) { char t[256], *pt = t; - int32_t i_interface, i_protocol, i_aprotocol, i_flags; + int32_t i_interface, i_protocol, i_aprotocol; + uint32_t u_flags; assert(host_name); /* avahi_log_debug(__FILE__": [%s] Successfully resolved service <%s.%s.%s>", i->path, name, type, domain); */ - assert(a); - avahi_address_snprint(t, sizeof(t), a); + if (a) + avahi_address_snprint(t, sizeof(t), a); + else + t[0] = 0; if (!name) name = ""; i_interface = (int32_t) interface; i_protocol = (int32_t) protocol; - i_aprotocol = (int32_t) a->proto; - i_flags = (int32_t) flags; + if (a) + i_aprotocol = (int32_t) a->proto; + else + i_aprotocol = AVAHI_PROTO_UNSPEC; + u_flags = (uint32_t) flags; dbus_message_append_args( reply, @@ -1524,8 +1591,11 @@ static void async_service_resolver_callback( dbus_message_append_args( reply, - DBUS_TYPE_INT32, &i_flags, + DBUS_TYPE_UINT32, &u_flags, DBUS_TYPE_INVALID); + } else { + assert(event == AVAHI_RESOLVER_FAILURE); + append_server_error(reply); } dbus_message_set_destination(reply, i->client->name); @@ -1811,7 +1881,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "ResolveHostName")) { Client *client; - int32_t interface, protocol, aprotocol, flags; + int32_t interface, protocol, aprotocol; + uint32_t flags; char *name; SyncHostNameResolverInfo *i; @@ -1821,7 +1892,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void DBUS_TYPE_INT32, &protocol, DBUS_TYPE_STRING, &name, DBUS_TYPE_INT32, &aprotocol, - DBUS_TYPE_INT32, &flags, + DBUS_TYPE_UINT32, &flags, DBUS_TYPE_INVALID) || !name) { avahi_log_warn("Error parsing Server::ResolveHostName message"); goto fail; @@ -1852,7 +1923,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "ResolveAddress")) { Client *client; - int32_t interface, protocol, flags; + int32_t interface, protocol; + uint32_t flags; char *address; SyncAddressResolverInfo *i; AvahiAddress a; @@ -1862,7 +1934,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void DBUS_TYPE_INT32, &interface, DBUS_TYPE_INT32, &protocol, DBUS_TYPE_STRING, &address, - DBUS_TYPE_INT32, &flags, + DBUS_TYPE_UINT32, &flags, DBUS_TYPE_INVALID) || !address) { avahi_log_warn("Error parsing Server::ResolveAddress message"); goto fail; @@ -1905,7 +1977,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void NULL, NULL }; - int32_t interface, protocol, type, flags; + int32_t interface, protocol, type; + uint32_t flags; char *domain; if (!dbus_message_get_args( @@ -1914,7 +1987,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void DBUS_TYPE_INT32, &protocol, DBUS_TYPE_STRING, &domain, DBUS_TYPE_INT32, &type, - DBUS_TYPE_INT32, &flags, + DBUS_TYPE_UINT32, &flags, DBUS_TYPE_INVALID) || type < 0 || type >= AVAHI_DOMAIN_BROWSER_MAX) { avahi_log_warn("Error parsing Server::DomainBrowserNew message"); goto fail; @@ -1959,7 +2032,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void NULL, NULL }; - int32_t interface, protocol, flags; + int32_t interface, protocol; + uint32_t flags; char *domain; if (!dbus_message_get_args( @@ -1967,7 +2041,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void DBUS_TYPE_INT32, &interface, DBUS_TYPE_INT32, &protocol, DBUS_TYPE_STRING, &domain, - DBUS_TYPE_INT32, &flags, + DBUS_TYPE_UINT32, &flags, DBUS_TYPE_INVALID)) { avahi_log_warn("Error parsing Server::ServiceTypeBrowserNew message"); goto fail; @@ -2013,7 +2087,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void NULL, NULL }; - int32_t interface, protocol, flags; + int32_t interface, protocol; + uint32_t flags; char *domain, *type; if (!dbus_message_get_args( @@ -2022,7 +2097,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void DBUS_TYPE_INT32, &protocol, DBUS_TYPE_STRING, &type, DBUS_TYPE_STRING, &domain, - DBUS_TYPE_INT32, &flags, + DBUS_TYPE_UINT32, &flags, DBUS_TYPE_INVALID) || !type) { avahi_log_warn("Error parsing Server::ServiceBrowserNew message"); goto fail; @@ -2059,7 +2134,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "ResolveService")) { Client *client; - int32_t interface, protocol, aprotocol, flags; + int32_t interface, protocol, aprotocol; + uint32_t flags; char *name, *type, *domain; SyncServiceResolverInfo *i; @@ -2071,7 +2147,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void DBUS_TYPE_STRING, &type, DBUS_TYPE_STRING, &domain, DBUS_TYPE_INT32, &aprotocol, - DBUS_TYPE_INT32, &flags, + DBUS_TYPE_UINT32, &flags, DBUS_TYPE_INVALID) || !type) { avahi_log_warn("Error parsing Server::ResolveService message"); goto fail; @@ -2108,7 +2184,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "ServiceResolverNew")) { Client *client; - int32_t interface, protocol, aprotocol, flags; + int32_t interface, protocol, aprotocol; + uint32_t flags; char *name, *type, *domain; AsyncServiceResolverInfo *i; static const DBusObjectPathVTable vtable = { @@ -2128,7 +2205,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void DBUS_TYPE_STRING, &type, DBUS_TYPE_STRING, &domain, DBUS_TYPE_INT32, &aprotocol, - DBUS_TYPE_INT32, &flags, + DBUS_TYPE_UINT32, &flags, DBUS_TYPE_INVALID) || !type) { avahi_log_warn("Error parsing Server::ServiceResolverNew message"); goto fail; @@ -2169,7 +2246,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "HostNameResolverNew")) { Client *client; - int32_t interface, protocol, aprotocol, flags; + int32_t interface, protocol, aprotocol; + uint32_t flags; char *name; AsyncHostNameResolverInfo *i; static const DBusObjectPathVTable vtable = { @@ -2187,7 +2265,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void DBUS_TYPE_INT32, &protocol, DBUS_TYPE_STRING, &name, DBUS_TYPE_INT32, &aprotocol, - DBUS_TYPE_INT32, &flags, + DBUS_TYPE_UINT32, &flags, DBUS_TYPE_INVALID) || !name) { avahi_log_warn("Error parsing Server::HostNameResolverNew message"); goto fail; @@ -2220,7 +2298,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "AddressResolverNew")) { Client *client; - int32_t interface, protocol, flags; + int32_t interface, protocol; + uint32_t flags; char *address; AsyncAddressResolverInfo *i; AvahiAddress a; @@ -2238,7 +2317,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void DBUS_TYPE_INT32, &interface, DBUS_TYPE_INT32, &protocol, DBUS_TYPE_STRING, &address, - DBUS_TYPE_INT32, &flags, + DBUS_TYPE_UINT32, &flags, DBUS_TYPE_INVALID) || !address) { avahi_log_warn("Error parsing Server::AddressResolverNew message"); goto fail;