Exemplo n.º 1
0
static void watch_proxy(DBusConnection *connection, void *user_data)
{
	struct serial_proxy *proxy = user_data;

	proxy->watch = 0;
	unregister_proxy(proxy);
}
Exemplo n.º 2
0
static DBusMessage *remove_proxy(DBusConnection *conn,
				DBusMessage *msg, void *data)
{
	struct serial_adapter *adapter = data;
	struct serial_proxy *prx;
	const char *path, *sender;
	GSList *l;

	if (!dbus_message_get_args(msg, NULL,
				DBUS_TYPE_STRING, &path,
				DBUS_TYPE_INVALID))
		return NULL;

	l = g_slist_find_custom(adapter->proxies, path, proxy_pathcmp);
	if (!l)
		return does_not_exist(msg, "Invalid proxy path");

	prx = l->data;

	sender = dbus_message_get_sender(msg);
	if (g_strcmp0(prx->owner, sender) != 0)
		return failed(msg, "Permission denied");

	unregister_proxy(prx);

	return dbus_message_new_method_return(msg);
}
Exemplo n.º 3
0
void Command::register_proxy(RootProxy *proxy) {
  // 1. make sure it is not in dictionary
  unregister_proxy(proxy);

  // 2. add to dictionary
  root_proxies_.set(proxy->remote_location(), proxy);
  root_proxies_vector_.push_back(proxy);
}