Commit Graph

168 Commits

Author SHA1 Message Date
Luiz Augusto von Dentz a559a4993b gdbus: Call check_signals when sending signals with g_dbus_send_message
If message passed to g_dbus_send_message is a signal verify if it is a
valid and there really exists an interface with respective signal name.
2012-12-30 10:49:27 -08:00
Luiz Augusto von Dentz 9ed7b17ca3 gdbus: Check if the interface being registered is valid
This prevent registering interfaces that are empty or have all members
marked as experiemental.
2012-12-30 10:49:27 -08:00
Luiz Augusto von Dentz 5f8485bcc1 gdbus: Introduce G_DBUS_PROPERTY_FLAG_EXPERIMENTAL
This flag can be used to mark properties as experimental, marked
properties are disabled by default and can be enabled by setting
G_DBUS_FLAG_ENABLE_EXPERIMENTAL using g_dbus_set_flags.
2012-12-30 10:49:27 -08:00
Luiz Augusto von Dentz 4b14fcc9a1 gdbus: Introduce G_DBUS_SIGNAL_FLAG_EXPERIMENTAL
This flag can be used to mark signals as experimental, marked
signals are disabled by default and can be enabled by setting
G_DBUS_FLAG_ENABLE_EXPERIMENTAL using g_dbus_set_flags.
2012-12-30 10:49:27 -08:00
Luiz Augusto von Dentz 4b50c0bd05 gdbus: Introduce G_DBUS_METHOD_FLAG_EXPERIMENTAL
This flag can be used to mark methods as experimental, marked
methods are disable by default and can be enabled by setting
G_DBUS_FLAG_ENABLE_EXPERIMENTAL using g_dbus_set_flags.
2012-12-30 10:49:27 -08:00
Marcel Holtmann 37a54d0433 gdbus: Include changed properties only once per signal 2012-12-30 00:58:59 -08:00
Marcel Holtmann 2f3da9cdf4 gdbus: Update properties on D-Bus client re-connections 2012-12-29 14:49:38 -08:00
Marcel Holtmann f9f6536b2b gdbus: Add function to manually refresh properties 2012-12-29 14:49:38 -08:00
Marcel Holtmann 816c028a94 gdbus: Add support for proxy property change notifications 2012-12-29 14:49:38 -08:00
Marcel Holtmann d3899c7af6 gdbus: Fix handling of client connect/disconnect signals 2012-12-29 14:49:38 -08:00
Marcel Holtmann cdd1febd4d gdbus: Protect standalone proxy creation with client reference 2012-12-29 14:49:37 -08:00
Marcel Holtmann 9ba681ddcd gdbus: Use object manager only if callback functions are set 2012-12-27 23:59:19 -08:00
Marcel Holtmann 91e3369a38 gdbus: Use client service name and not hardcoded org.bluez 2012-12-27 23:59:19 -08:00
Marcel Holtmann 8bef871cff gdbus: Add support for creating D-Bus proxies without object manager 2012-12-27 23:59:19 -08:00
Marcel Holtmann d1bd840d2e gdbus: Avoid using g_ptr_array_new_full convenience function
The g_ptr_array_new_full function only got introduced with GLib 2.30
and to avoid requiring a newer GLib use g_ptr_array_set_free_func instead.
2012-12-22 12:09:58 -08:00
Marcel Holtmann fcab2080be gdbus: Increase the method call timeout to 5 minutes 2012-12-19 03:50:43 +01:00
Marcel Holtmann e7ca33f908 gdbus: Add helper for sending async error replies 2012-12-19 03:50:42 +01:00
Marcel Holtmann 5de077a604 gdbus: Fix race condition with creating duplicate client proxies 2012-12-19 03:50:42 +01:00
Marcel Holtmann 4a0cab2f85 gdbus: Fix issue with unref of client while parsing interfaces 2012-12-19 03:50:42 +01:00
Marcel Holtmann c3d3a3a661 gdbus: Fix issue with unref of client in connect handler 2012-12-19 03:50:42 +01:00
Marcel Holtmann 33ff02e3a4 gdbus: Add support for D-Bus client method calls 2012-12-19 03:50:42 +01:00
Marcel Holtmann 90c719f29c gdbus: Add callback support for handling property changes 2012-12-19 03:50:42 +01:00
Marcel Holtmann f40f27cd44 gdbus: Handle property changed signals and update property 2012-12-19 03:50:42 +01:00
Marcel Holtmann 64103f35a1 gdbus: Set property changed filter match rule for each proxy 2012-12-19 03:50:42 +01:00
Marcel Holtmann ec448e4d36 gdbus: Use a GPtrArray for the match rules 2012-12-19 03:50:42 +01:00
Marcel Holtmann 7ba21da7f3 gdbus: Add support for setting D-Bus client basic properties 2012-12-19 03:50:42 +01:00
Marcel Holtmann 37a3708928 gdbus: Deep copy of variants also requires a signature 2012-12-19 03:50:42 +01:00
Marcel Holtmann ada304fb01 gdbus: Add support for complex D-Bus client properties 2012-12-19 03:50:42 +01:00
Marcel Holtmann 8ec0dab7fa gdbus: Add support for D-Bus client properties 2012-12-19 03:50:42 +01:00
Marcel Holtmann b30177d961 gdbus: Add support for D-Bus client proxies 2012-12-19 03:50:42 +01:00
Marcel Holtmann 8d5bb26e43 gdbus: Add helper functions for simple D-Bus clients 2012-12-19 03:50:42 +01:00
Luiz Augusto von Dentz 4e95013040 gdbus: Add g_dbus_add_properties_watch function
Convenient function to create watches for D-Bus properties.
2012-11-30 09:59:34 +01:00
Lucas De Marchi 2e9bea7af6 gdbus: Don't automatically attach ObjectManager
Let each project attach the object manager interface instead of
registering it automatically.
2012-11-29 17:38:55 +01:00
Lucas De Marchi 959d23833f gdbus: Don't register DBus.Properties with no properties
Delay registering DBus.Properties interface until the moment there are
properties on that path. This is needed for objects that currently don't
expose any property to not export the interface.
2012-11-29 17:38:55 +01:00
Szymon Janc c091a5c5e7 gdbus: Remove not needed NULL pointer checks
g_strdup returns NULL if argument passed is NULL and there is no need
to double check that.
2012-11-26 12:59:48 +01:00
Syam Sidhardhan 682bf79a83 gdbus: Replace leading spaces with tabs
Trivial formatting fix.
2012-11-26 12:59:30 +01:00
Syam Sidhardhan 0581ec199c gdbus: Fix compilation error due to missing #defines
Since these are simple #define strings, we are defining it here
instead of upgrading to D-Bus 1.5 or later.

Log:
  CC     gdbus/object.o
gdbus/object.c: In function ‘properties_set’:
gdbus/object.c:876:7: error: ‘DBUS_ERROR_UNKNOWN_PROPERTY’ undeclared
 (first use in this function)
gdbus/object.c:876:7: note: each undeclared identifier is reported
 only once for each function it appears in
gdbus/object.c:881:6: error: ‘DBUS_ERROR_PROPERTY_READ_ONLY’
 undeclared (first use in this function)
make[1]: *** [gdbus/object.o] Error 1
make: *** [all] Error 2
2012-11-26 12:59:16 +01:00
Lucas De Marchi 2e6824dbb0 gdbus: Remove connection from pending_property functions
The reply to a DBus.Properties.Set() method call should go through the
same D-Bus connection. Thus remove the DBusConnection parameter from the
following functions:

    - g_dbus_pending_property_success()
    - g_dbus_pending_property_error_valist()
    - g_dbus_pending_property_error()
2012-11-26 12:58:54 +01:00
Johan Hedberg 8aaa110370 gdbus: Fix invalid memory access during interface removal
If an interface is removed from the root path during the same mainloop
iteration that it was added we need to check for data->added before
doing the check for data->parent == NULL in the remove_interface()
function. Otherwise the added interface doesn't get removed from the
data->added list and will result in accessing freed memory:

==337== Invalid read of size 8
==337==    at 0x4F65AFA: dbus_message_iter_append_basic (in /usr/lib64/libdbus-1.so.3.7.1)
==337==    by 0x1247B5: append_interface (object.c:556)
==337==    by 0x4C8DC5C: g_slist_foreach (gslist.c:840)
==337==    by 0x1261F7: process_changes (object.c:594)
==337==    by 0x126372: generic_unregister (object.c:997)
==337==    by 0x4F69669: ??? (in /usr/lib64/libdbus-1.so.3.7.1)
==337==    by 0x4F5CE51: dbus_connection_unregister_object_path (in /usr/lib64/libdbus-1.so.3.7.1)
==337==    by 0x125E81: object_path_unref (object.c:1236)
==337==    by 0x126136: g_dbus_unregister_interface (object.c:1361)
==337==    by 0x14CDF0: service_exit (service.c:581)
==337==    by 0x177556: plugin_cleanup (plugin.c:242)
==337==    by 0x12221F: main (main.c:559)
==337==  Address 0x5bc1550 is 0 bytes inside a block of size 56 free'd
==337==    at 0x4A079AE: free (vg_replace_malloc.c:427)
==337==    by 0x4C7850E: g_free (gmem.c:252)
==337==    by 0x125DB0: remove_interface (object.c:671)
==337==    by 0x125E3B: object_path_unref (object.c:1230)
==337==    by 0x126136: g_dbus_unregister_interface (object.c:1361)
==337==    by 0x14CDF0: service_exit (service.c:581)
==337==    by 0x177556: plugin_cleanup (plugin.c:242)
==337==    by 0x12221F: main (main.c:559)
2012-11-26 12:58:38 +01:00
Johan Hedberg f9f49f5d42 gdbus: Add g_dbus_get_properties function
This function can be used to construct custom D-Bus messages containing
the properties for a specific interface on a given path.
2012-11-26 12:58:00 +01:00
Johan Hedberg 031189ffea gdbus: Add support for invalidated properties
If there's a pending property but its exists() callback returns false
the property should be considered invalidated and included in the
relevant list of the PropertiesChanged signal.
2012-11-26 12:57:43 +01:00
Johan Hedberg c4ec194ede gdbus: Fix processing pending properties in remove_interface() 2012-11-26 12:57:26 +01:00
Lucas De Marchi d1d2f6dbe1 gdbus: Fix up Properties.Set() code path
Minor fixes to make setter actually work:

	- Add propdata in pending_property_set
	- Break loop when we are removing propdata from list and we
	  found it
	- in_args and out_args were swapped
	- interface and method name arguments were swapped
2012-11-26 12:56:53 +01:00
Lucas De Marchi 7071d8a28e gdbus: Fix invalid memory access while unregistering
If an interface is added and removed on the same mailoop iteration,
ObjectManager would try to send InterfacesAdded signal while running the
idler because the interface was added to data->added list.

This is easily reproduced by forcing an error path in a plugin
registration, like on sap_server_register(), resulting in the following
error:

==11795== Invalid read of size 4
==11795==    at 0x496F592: dbus_message_iter_append_basic (dbus-message.c:2598)
==11795==    by 0x117B39: append_interface (object.c:554)
==11795==    by 0x48955E7: g_slist_foreach (gslist.c:840)
==11795==    by 0x11923B: process_changes (object.c:592)
==11795==    by 0x11956D: generic_unregister (object.c:980)
==11795==    by 0x4973BAC: _dbus_object_tree_unregister_and_unlock (dbus-object-tree.c:516)
==11795==    by 0x4965240: dbus_connection_unregister_object_path (dbus-connection.c:5776)
==11795==    by 0x1178A5: object_path_unref (object.c:1219)
==11795==    by 0x118517: g_dbus_unregister_interface (object.c:1344)
==11795==    by 0x19AF5B: sap_exit (sap.c:385)
==11795==    by 0x13E9E2: sap_server_register (server.c:1428)
==11795==    by 0x13C092: sap_server_probe (manager.c:44)

With this patch we don't send the InterfacesAdded signal, removing it
from data->added while unregistering.
2012-11-26 12:56:40 +01:00
Lucas De Marchi a8e02420b4 gdbus: Implement PropertiesChanged signal 2012-11-26 12:56:11 +01:00
Luiz Augusto von Dentz fd33855e53 gdbus: Simplify code for appending properties
This reuse append_properties for GetAll and GetManagedObjects
2012-11-26 12:55:45 +01:00
Luiz Augusto von Dentz 11ba5b9aa2 gdbus: Integrates ObjectManager with Properties interface
This appends the properties and its values when using ObjectManager.
2012-11-26 12:55:25 +01:00
Luiz Augusto von Dentz cf296a9da9 gdbus: Only export ObjectManager interface on root path
ObjectManager should be exported only in the root path and list all
the children paths.
2012-11-26 12:55:07 +01:00
Luiz Augusto von Dentz f28e6ae984 gdbus: Group interface changes to reduce the amount of signals emitted
InterfacesAdded and InterfacesRemoved can group all the interfaces
changes together in one message.
2012-11-26 12:54:45 +01:00
Luiz Augusto von Dentz 7db2a0bfcc gdbus: Add support for org.freedesktop.DBus.ObjectManager interface
This implements initial support for ObjectManager, it automatically adds
objects to its parents so no action is needed by daemons to get their
objects managed by this interface.

ObjectManager is part of D-Bus spec since revision 0.17:
http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager
2012-11-26 12:54:27 +01:00
Lucas De Marchi 8c634044ed gdbus: Add properties into Introspectable interface 2012-11-26 12:54:05 +01:00
Lucas De Marchi d87dcb6c5b gdbus: Implement DBus.Properties.Set method
Contrary to Get() and GetAll(), Set() is asynchronous so we pass an id
to the setter so later it can declare the Set() as successful or
otherwise.
2012-11-26 12:53:40 +01:00
Lucas De Marchi 1b7afd7b1e gdbus: Implement DBus.Properties.GetAll method 2012-11-26 12:53:23 +01:00
Lucas De Marchi 337e908edd gdbus: Implement DBus.Properties.Get method 2012-11-26 12:52:56 +01:00
Lucas De Marchi 1315c48085 gdbus: Add skeleton of DBus.Properties interface
This interface is responsible for handling properties of all objects in
a given path. Right now it only registers itself, doing nothing useful.
A conversion to this new layout will be done by subsequent patches.

org.freedesktop.org.DBus.Properties spec can be found at
http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties
2012-11-26 12:52:23 +01:00
Lucas De Marchi cb44357b67 gdbus: Use macros to add annotations
Besides being more readable this way it avoids going over 80 chars.
2012-11-26 12:51:53 +01:00
Lucas De Marchi 0e1baf1997 gdbus: Move typedefs up
Move the typedefs up so they can be used by functions and callbacks.
2012-11-26 12:51:29 +01:00
Luiz Augusto von Dentz 320096a7da gdbus: Fix not freeing list node by using g_slist_delete_link
g_slist_remove_link does not free the node which can cause leaks so
replace that with g_slist_delete_link which does free memory properly.
2012-10-31 16:18:58 -05:00
Lucas De Marchi 19cb623390 gdbus: Refactor filter_data_find()
Now this function is only used for searching the listeners of a
connection and the other parameters are not needed anymore.
2012-10-31 16:18:53 -05:00
Lucas De Marchi 5236c01a31 gdbus: Fix wrong signal handler match
When we add a signal handler with g_dbus_add_signal_watch(), this
function tries to multiplex the matches added in libdbus by checking
if there's a previous filter_data with the same fields. However, if the
field is NULL it accepts as being the same. The result is that the
following watches will use the same filter data:

watch1 = g_dbus_add_signal_watch(conn, BUS_NAME, NULL, iface, member,
						cb1, data1, NULL);
watch2 = g_dbus_add_signal_watch(conn, BUS_NAME, "/path2", iface, member,
						cb2, data2, NULL);
watch3 = g_dbus_add_signal_watch(conn, BUS_NAME, "/path3", iface, member,
						cb3, data3, NULL);

The result is that when a signal arrives with path == "/path2", all 3
callbacks above will be called, with the same signal delivered to all of
them.

Another problem is that, if we invert the calls like below, only signals
to cb1 will never be trigerred, nonetheless it used path == NULL.

watch2 = g_dbus_add_signal_watch(conn, BUS_NAME, "/path2", iface, member,
						cb2, data2, NULL);
watch1 = g_dbus_add_signal_watch(conn, BUS_NAME, NULL, iface, member,
						cb1, data1, NULL);
watch3 = g_dbus_add_signal_watch(conn, BUS_NAME, "/path3", iface, member,
						cb3, data3, NULL);

This is fixed by not multiplexing the matchs with filter data if any of
the fields are different, including being NULL. When a signal arrives,
if a field is NULL we accept it as a match, but not when adding the
signal handler.
2012-10-31 16:18:45 -05:00
Johan Hedberg 5033e06844 gdbus: Fix crash when getting disconnected from the bus
When getting disconnected from the bus sometimes (maybe always?)
dbus_watch_handle() can cause the "info" context to be free'd meaning
that we should not try to access it after the call. The only member we
need access to is the connection pointer and as the code already has a
ref() call for it it's only natural to solve the issue by adding a local
variable not dependent on "info".

The backtrace of the crash fixed looks as follows:

 Invalid read of size 8
   at 0x121085: watch_func (mainloop.c:105)
   by 0x4C72694: g_main_context_dispatch (gmain.c:2539)
   by 0x4C729C7: g_main_context_iterate.isra.23 (gmain.c:3146)
   by 0x4C72DC1: g_main_loop_run (gmain.c:3340)
   by 0x120541: main (main.c:551)
 Address 0x5bbcd90 is 16 bytes inside a block of size 24 free'd
   at 0x4A079AE: free (vg_replace_malloc.c:427)
   by 0x4C7837E: g_free (gmem.c:252)
   by 0x4F708BF: dbus_watch_set_data (dbus-watch.c:614)
   by 0x4F70938: _dbus_watch_unref (dbus-watch.c:132)
   by 0x4F6E9A7: _dbus_transport_handle_watch (dbus-transport.c:884)
   by 0x4F59AFB: _dbus_connection_handle_watch (dbus-connection.c:1497)
   by 0x4F70AF9: dbus_watch_handle (dbus-watch.c:683)
   by 0x121084: watch_func (mainloop.c:103)
   by 0x4C72694: g_main_context_dispatch (gmain.c:2539)
   by 0x4C729C7: g_main_context_iterate.isra.23 (gmain.c:3146)
   by 0x4C72DC1: g_main_loop_run (gmain.c:3340)
   by 0x120541: main (main.c:551)
2012-10-31 16:18:41 -05:00
Jaganath Kanakkassery c1cea66a5e gdbus: Fix compilation error if macro "error" is defined
The variable "signature" used in error is not defined and "args" is now
a struct instead of a string.
2012-08-27 17:28:42 -07:00
Lucas De Marchi daca27425f gdbus: Fix removal of filter after last filter_data
If there's a signal watch that's also watching for name
(data->name_watch) currently we are trying to remove the message_filter
twice since we may have the following call chain:

filter_data_remove_callback()
  filter_data_free()
    g_dbus_remove_watch()
      filter_data_remove_callback()
	filter_data_free()
        dbus_connection_remove_filter()
  dbus_connection_remove_filter()

Because of this we can't currently watch for signals passing the bus
name. After this patch we don't have this issue anymore.

We fix it by removing the filter before calling filter_data_free() if we
are the last filter_data and thus avoid calling
dbus_connection_remove_filter() twice.
2012-06-30 10:39:11 +02:00
Mikel Astiz ce395cd818 gdbus: Fix incorrectly discarded signals
Signals with no arguments were incorrectly filtered out due to the NULL
inequality check.
2012-05-22 20:27:56 +02:00
Lucas De Marchi 4fa967e7e2 gdbus: do not check signature twice
Message signature is already checked in generic_message(), so there's no
need to check again in the callback.
2012-05-20 02:47:57 -07:00
Lucas De Marchi e400426267 gdbus: add Method.NoReply annotation in introspection 2012-05-20 02:47:57 -07:00
Lucas De Marchi e42130a83b gdbus: add Deprecated annotation in introspection 2012-05-20 02:47:57 -07:00
Lucas De Marchi 7f2b69d7b8 gdbus: remove signature and reply from tables 2012-05-20 02:47:57 -07:00
Lucas De Marchi ce3345e21d gdbus: loop over args to check message signature 2012-05-20 02:47:57 -07:00
Lucas De Marchi 568a7d0707 gdbus: use GDBusArgInfo to generate introspection
By using GDBusArgInfo in methods and signals, the introspection
generation is much simpler and we can add each argument name.
2012-05-20 02:47:57 -07:00
Lucas De Marchi 8e815c100b gdbus: add and use helpers for table declarations 2012-05-20 02:47:57 -07:00
Lucas De Marchi d1a1a9bcc9 gdbus: add argument info to methods and signals 2012-05-20 02:47:56 -07:00
Marcel Holtmann addd756348 gdbus: Constify introspection method table 2012-05-17 19:58:02 -07:00
Lucas De Marchi 37805e0197 gdbus: do not call memset for terminating NUL 2012-05-17 19:58:01 -07:00
Lucas De Marchi a77fcca3c6 gdbus: return if method signature is malformed 2012-05-17 19:58:01 -07:00
Marcel Holtmann 9d789c57d7 gdbus: Remove unneeded NEED_DBUS_WATCH_GET_UNIX_FD check 2012-04-16 17:57:08 +02:00
Anderson Lizardo 9b26016a24 gdbus: Use destroy callback for service watch
Even though service watches accepted a "destroy" callback, they were
being ignored. This fix properly pass them along so they are called when
the watch is removed.
2012-04-05 08:07:35 -07:00
Syam Sidhardhan 2f232f8b02 gdbus: Fix white space coding style issue
- corrected the space before '{'
2012-04-05 08:07:28 -07:00
Szymon Janc ecd56f7a07 gdbus: Remove unused result variable from g_dbus_pending_success 2011-05-27 09:53:38 -07:00
Grant Erickson e37fcb4af3 gdbus: Unconditionally remove D-Bus timeouts
Address an issue in which the daemon incorrectly handles D-Bus main
loop timeouts by only removing timeouts that are not enabled when
D-Bus requests a timeout removal.
2011-03-09 13:32:32 -08:00
Daniel Wagner 1ef27ffe86 gdbus: Remove root node 'name' attribute in introspection
generate_introspection_xml generates the root <node> tags with a
'name' attribute. This seems to be a valid attribute but it is not
consistent with the way the D-Bus daemon generates empty nodes.

For example if we register "/foo/bar", D-Bus daemon will generate for
"/foo" a introspection which looks like this:

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
  <node name="bar"/>
</node>

and generate_introspection_xml generates for "/foo/bar":

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/foo/bar">
</node>

Just don't add the 'name' attribute to the root node.  The GLib
binding for D-Bus does it the same way.
2011-01-19 17:25:30 +01:00
Daniel Wagner 28ec0e2174 gdbus: invaldate_parent_data: walk the whole path down
Assume there is only one object registerd at "/". If we add a new
object at "/foo/bar" the introspection of "/" has to be updated. A new
node has to be added at "/".

invalidate_parent_data stops invaldating the whole path because the
boolean return value of dbus_connection_get_object_path_data is used
wrong.

If we get a TRUE just go on down in the path, if FALSE is return
dbus_connection_get_object_path_data has run out of memory.
2011-01-19 17:25:30 +01:00
Marcel Holtmann e5120c96e9 gdbus: Update copyright information 2011-01-01 17:32:29 -08:00
Johan Hedberg a437bfba54 gdbus: fix accessing freed callback data
cb->disc_func or cb->conn_func could remove the callback so this needs
to be checked for before continuing processing.
2010-12-10 00:07:53 +01:00
Lucas De Marchi 752a2ccec8 gdbus: explicitly compare pointers to NULL
This patch was generated by the following semantic patch
(http://coccinelle.lip6.fr/)

// <smpl>
@fix disable is_null,isnt_null1@
expression *E;
@@

- !E
+ E == NULL
// </smpl>
2010-12-08 16:33:06 +01:00
Luiz Augusto von Dentz c896d11724 gdbus: fix not handling bus disconnects
We where not dispatching data when a bus disconnects which cause
Disconnected signal to not be processed and thus causing the process to
either not exit or to not trigger callbacks registered with
g_dbus_set_disconnect_function.

To fix this now we always schedule a dispatch which will make sure data
still not processed will make its way to the proper handlers even if
disconnected.
2010-10-13 15:55:26 +03:00
Marcel Holtmann f02dd45e0b Add support for builtin GDBus security using PolicyKit 2010-09-09 18:26:37 +02:00
Marcel Holtmann e173173a1f Add support for GDBus security action and flags 2010-09-09 18:26:36 +02:00
Marcel Holtmann 679f17303d Use simpler error callbacks for GDBus security hooks 2010-09-09 18:26:36 +02:00
Marcel Holtmann 8ef8135a2a Add support for GDBus security handlers 2010-09-09 18:26:36 +02:00
Luiz Augusto von Dentz fbf3bcd87d Fix calling watch callbacks after it has been removed
Pending call should be removed if the watch is removed since the
application no longer expect that to be reached and may already freed the
data associated with it.
2010-09-08 18:28:23 +02:00
Luiz Augusto Von Dentz 79e5dc585d Fix signal watch when a service name is given
The bus name should be resolved when adding a watch by service name since
messages do always come with sender set to owner's bus name, also it
should listen to owner updates since it can change without invalidating
the watch.
2010-09-08 18:28:23 +02:00
Luiz Augusto Von Dentz 93d5bd6af8 Do not automatically remove watches for service names
Services can be owned again so it is perfectly fine to keep the watch.
2010-09-08 18:28:23 +02:00
Marcel Holtmann f261f38fd9 Add printf format attribute for error creation helper 2010-08-19 19:35:04 +02:00
Zhenhua Zhang 04fffa93a1 Free service data in service_reply
Avoid the memory leak of server_data.
2010-07-26 07:30:48 -07:00
Johan Hedberg 58b37ddb53 Fix parent path introspection data invalidation for multiple levels
In the case that parent path data needs to be invalidated we shouldn't
stop at the immediate parent if it doesn't have our own handler
registered but should continue upwards in the tree until we reach root
or our own handler.
2010-04-30 00:30:54 +02:00
Johan Hedberg 3f2494a7b0 Fix memory leak in g_dbus_register_interface 2010-04-29 23:46:12 +02:00
Marcel Holtmann ab5dcea4fd Make interface callback tables const 2010-03-07 14:33:09 -08:00
Vinicius Costa Gomes a181ec319b Fix the case when the requested name is already in use
We weren't setting the dbus error in this situation.
2010-03-07 14:32:03 -08:00
Vinicius Costa Gomes 2e9a16ce07 Fix: a pending call was leaking in check_service
This was triggering an assert inside libdbus when the timeout inside
the leaking pending call expired. The assert said that we were trying
to remove an nonexistent timeout.
2010-02-17 01:59:31 -08:00