~ubuntu-branches/ubuntu/jaunty/avahi/jaunty-updates

« back to all changes in this revision

Viewing changes to avahi-daemon/dbus-protocol.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2006-09-03 20:25:37 UTC
  • mfrom: (1.1.15 upstream)
  • Revision ID: james.westby@ubuntu.com-20060903202537-syi99j0tijm9bldv
Tags: 0.6.13-2ubuntu1
* Merge with Debian, UVF Exception granted by Colin Watson
* debian/patches/03_foreground-console.patch:
  + Allow only foreground users access to the avahi-set-host-name utility as
    we don't use the "netdev" group anywhere. Thanks to Colin Watson for the
    hint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: dbus-protocol.c 1238 2006-07-18 22:25:22Z lathiat $ */
 
1
/* $Id: dbus-protocol.c 1260 2006-08-22 01:49:25Z lennart $ */
2
2
 
3
3
/***
4
4
  This file is part of avahi.
43
43
#include <avahi-common/dbus.h>
44
44
#include <avahi-common/llist.h>
45
45
#include <avahi-common/malloc.h>
46
 
#include <avahi-common/dbus.h>
47
46
#include <avahi-common/dbus-watch-glue.h>
48
47
#include <avahi-common/alternative.h>
49
48
#include <avahi-common/error.h>
265
264
 
266
265
        return avahi_dbus_respond_string(c, m, avahi_server_get_host_name(avahi_server));
267
266
        
 
267
    } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "SetHostName")) {
 
268
 
 
269
        char *name;
 
270
        
 
271
        if (!dbus_message_get_args(m, &error, DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID)) {
 
272
            avahi_log_warn("Error parsing Server::SetHostName message");
 
273
            goto fail;
 
274
        }
 
275
        
 
276
        if (avahi_server_set_host_name(avahi_server, name) < 0) 
 
277
            return avahi_dbus_respond_error(c, m, avahi_server_errno(avahi_server), NULL);
 
278
 
 
279
        avahi_log_info("Changing host name to '%s'.", name);
 
280
        
 
281
        return avahi_dbus_respond_ok(c, m);
 
282
        
268
283
    } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetDomainName")) {
269
284
 
270
285
        if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {