summaryrefslogtreecommitdiff
path: root/gdbus/object.c
Commit message (Collapse)AuthorAgeFilesLines
* gdbus: Don't automatically attach ObjectManagerLucas De Marchi2012-11-291-21/+33
| | | | | Let each project attach the object manager interface instead of registering it automatically.
* gdbus: Don't register DBus.Properties with no propertiesLucas De Marchi2012-11-291-3/+6
| | | | | | 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.
* gdbus: Replace leading spaces with tabsSyam Sidhardhan2012-11-261-4/+4
| | | | Trivial formatting fix.
* gdbus: Fix compilation error due to missing #definesSyam Sidhardhan2012-11-261-0/+8
| | | | | | | | | | | | | | | | | 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
* gdbus: Remove connection from pending_property functionsLucas De Marchi2012-11-261-12/+12
| | | | | | | | | | 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()
* gdbus: Fix invalid memory access during interface removalJohan Hedberg2012-11-261-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* gdbus: Add g_dbus_get_properties functionJohan Hedberg2012-11-261-0/+19
| | | | | This function can be used to construct custom D-Bus messages containing the properties for a specific interface on a given path.
* gdbus: Add support for invalidated propertiesJohan Hedberg2012-11-261-1/+14
| | | | | | 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.
* gdbus: Fix processing pending properties in remove_interface()Johan Hedberg2012-11-261-0/+2
|
* gdbus: Fix up Properties.Set() code pathLucas De Marchi2012-11-261-3/+7
| | | | | | | | | | 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
* gdbus: Fix invalid memory access while unregisteringLucas De Marchi2012-11-261-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* gdbus: Implement PropertiesChanged signalLucas De Marchi2012-11-261-2/+106
|
* gdbus: Simplify code for appending propertiesLuiz Augusto von Dentz2012-11-261-32/+2
| | | | This reuse append_properties for GetAll and GetManagedObjects
* gdbus: Integrates ObjectManager with Properties interfaceLuiz Augusto von Dentz2012-11-261-1/+27
| | | | This appends the properties and its values when using ObjectManager.
* gdbus: Only export ObjectManager interface on root pathLuiz Augusto von Dentz2012-11-261-2/+15
| | | | | ObjectManager should be exported only in the root path and list all the children paths.
* gdbus: Group interface changes to reduce the amount of signals emittedLuiz Augusto von Dentz2012-11-261-154/+208
| | | | | InterfacesAdded and InterfacesRemoved can group all the interfaces changes together in one message.
* gdbus: Add support for org.freedesktop.DBus.ObjectManager interfaceLuiz Augusto von Dentz2012-11-261-10/+237
| | | | | | | | | 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
* gdbus: Add properties into Introspectable interfaceLucas De Marchi2012-11-261-0/+19
|
* gdbus: Implement DBus.Properties.Set methodLucas De Marchi2012-11-261-1/+141
| | | | | | 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.
* gdbus: Implement DBus.Properties.GetAll methodLucas De Marchi2012-11-261-1/+55
|
* gdbus: Implement DBus.Properties.Get methodLucas De Marchi2012-11-261-1/+61
|
* gdbus: Add skeleton of DBus.Properties interfaceLucas De Marchi2012-11-261-0/+46
| | | | | | | | | 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
* gdbus: Use macros to add annotationsLucas De Marchi2012-11-261-12/+28
| | | | Besides being more readable this way it avoids going over 80 chars.
* gdbus: Fix compilation error if macro "error" is definedJaganath Kanakkassery2012-08-161-2/+2
| | | | | The variable "signature" used in error is not defined and "args" is now a struct instead of a string.
* gdbus: Fix incorrectly discarded signalsMikel Astiz2012-05-221-7/+3
| | | | | Signals with no arguments were incorrectly filtered out due to the NULL inequality check.
* gdbus: do not check signature twiceLucas De Marchi2012-05-181-5/+0
| | | | | Message signature is already checked in generic_message(), so there's no need to check again in the callback.
* gdbus: add Method.NoReply annotation in introspectionLucas De Marchi2012-05-181-1/+6
|
* gdbus: add Deprecated annotation in introspectionLucas De Marchi2012-05-181-2/+17
|
* gdbus: remove signature and reply from tablesLucas De Marchi2012-05-181-1/+1
|
* gdbus: loop over args to check message signatureLucas De Marchi2012-05-181-7/+27
|
* gdbus: use GDBusArgInfo to generate introspectionLucas De Marchi2012-05-181-61/+14
| | | | | By using GDBusArgInfo in methods and signals, the introspection generation is much simpler and we can add each argument name.
* gdbus: remove extra const after constificationLucas De Marchi2012-05-181-1/+1
|
* gdbus: add and use helpers for table declarationsLucas De Marchi2012-05-171-1/+2
|
* Constify GDBus method tablesMarcel Holtmann2012-05-171-1/+1
| | | | | | | Constify method tables with the following command: find . -name '*.[ch]' -exec \ sed -i 's/\(GDBusMethodTable .* =\)/const \1/g' {} \;
* gdbus: Constify introspection method tableMarcel Holtmann2012-05-171-1/+1
|
* gdbus: do not call memset for terminating NULLucas De Marchi2012-05-171-1/+2
|
* gdbus: return if method signature is malformedLucas De Marchi2012-05-171-0/+4
|
* gdbus: Fix white space coding style issueSyam Sidhardhan2011-07-091-1/+1
| | | | - corrected the space before '{'
* Remove unused result variable from g_dbus_pending_successSzymon Janc2011-05-151-2/+1
|
* gdbus: Remove root node 'name' attribute in introspectionDaniel Wagner2011-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* gdbus: invaldate_parent_data: walk the whole path downDaniel Wagner2011-01-191-3/+4
| | | | | | | | | | | | | 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.
* gdbus: Update copyright informationMarcel Holtmann2011-01-011-1/+1
|
* gdbus: explicitly compare pointers to NULLLucas De Marchi2010-12-081-12/+12
| | | | | | | | | | | | | | 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>
* Add support for builtin GDBus security using PolicyKitMarcel Holtmann2010-09-091-1/+45
|
* Add support for GDBus security action and flagsMarcel Holtmann2010-09-091-3/+11
|
* Use simpler error callbacks for GDBus security hooksMarcel Holtmann2010-09-091-6/+23
|
* Add support for GDBus security handlersMarcel Holtmann2010-09-091-22/+137
|
* Fix parent path introspection data invalidation for multiple levelsJohan Hedberg2010-04-301-1/+3
| | | | | | | 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.
* Fix memory leak in g_dbus_register_interfaceJohan Hedberg2010-04-301-1/+3
|
* Make interface callback tables constMarcel Holtmann2010-03-071-13/+13
|