From fbce111b069aa1e4c701ed37ee1d9f6d6cefaac5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 6 Nov 2005 02:08:32 +0000 Subject: * add two new configuration file options: "disable-publishing" and "disable-user-service-publishing" * add two new errors: NOT_PERMITTED and NOT_SUPPORTED * add two new publishing flags: AVAHI_PUBLISH_USE_MULTICAST, AVAHI_PUBLISH_USE_WIDE_AREA * return NOT_SUPPORTED when user tries to add RRs in wide area domains - for now git-svn-id: file:///home/lennart/svn/public/avahi/trunk@930 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-daemon/dbus-protocol.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'avahi-daemon/dbus-protocol.c') diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c index 517b954..c6c4a67 100644 --- a/avahi-daemon/dbus-protocol.c +++ b/avahi-daemon/dbus-protocol.c @@ -63,6 +63,8 @@ Server *server = NULL; +static int disable_user_service_publishing = 0; + static void client_free(Client *c) { assert(server); @@ -386,6 +388,9 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH goto fail; } + if (disable_user_service_publishing) + return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_PERMITTED, NULL); + if (!(client = client_get(dbus_message_get_sender(m), TRUE))) { avahi_log_warn("Too many clients, client request failed."); return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL); @@ -917,7 +922,7 @@ void dbus_protocol_server_state_changed(AvahiServerState state) { dbus_message_unref(m); } -int dbus_protocol_setup(const AvahiPoll *poll_api) { +int dbus_protocol_setup(const AvahiPoll *poll_api, int _disable_user_service_publishing) { DBusError error; static const DBusObjectPathVTable server_vtable = { @@ -931,6 +936,8 @@ int dbus_protocol_setup(const AvahiPoll *poll_api) { dbus_error_init(&error); + disable_user_service_publishing = _disable_user_service_publishing; + server = avahi_new(Server, 1); AVAHI_LLIST_HEAD_INIT(Clients, server->clients); server->current_id = 0; -- cgit