summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-objects.c
AgeCommit message (Collapse)Author
2014-09-17bus: fix error leak in bus_node_exists()David Herrmann
If we call into user callbacks, we must always propagate possible errors. Fix bus_node_exists() to do that and adjust the callers (which already partially propagated the error). Also speed up that function by first checking for registered enumerators and/or object-managers.
2014-09-17bus: never respond to GetManagedObjects() on sub-pathsDavid Herrmann
The dbus-spec clearly specifies that GetManagedObjects() should only work on the root-path of an object-tree. But on that path, it works regardless whether there are any objects available or not. We could, technically, define all sub-paths as a root-path of its own sub-tree. However, if we do that, we enter undefined territory: Imagine only a fallback vtable is registered. We want GetManagedObjects() to *NOT* fail with UNKNOWN_METHOD if it is called on a valid sub-tree of the fallback. On the other hand, we don't want it to work on arbitrary sub-tree. Something like: /path/to/fallback/foobar/foobar/foobar/invalid/foobar should not work. However, there is no way to know which paths on a fallback are valid without looking at there registered objects. If no objects are registered, we have no way to figure it out. Therefore, we now try to follow the dbus spec by only returning valid data on registered root-paths. We treat each path as root which was registered an object-manager on via add_object_manager(). So applications can now directly control which paths to place an object-manager on. We also fix the introspection to not return object-manager interfaces on non-root paths. Also fixes some dead-code paths initially reported by Philippe De Swert.
2014-09-15hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt
It is redundant to store 'hash' and 'compare' function pointers in struct Hashmap separately. The functions always comprise a pair. Store a single pointer to struct hash_ops instead. systemd keeps hundreds of hashmaps, so this saves a little bit of memory.
2014-08-18Merge remote-tracking branch 'origin/master'Lennart Poettering
2014-08-18sd-bus: add API to query which handler/callback is currently being dispatchedLennart Poettering
2014-08-16sd-bus,log: remove unused variablesThomas Hindoe Paaboel Andersen
2014-08-15sd-bus: add API to check if a client has privilegesLennart Poettering
This is a generalization of the vtable privilege check we already have, but exported, and hence useful when preparing for a polkit change. This will deal with the complexity that on dbus1 one cannot trust the capability field we retrieve via the bus, since it is read via /proc/$$/stat (and thus might be out-of-date) rather than directly from the message (like on kdbus) or bus connection (as for uid creds on dbus1). Also, port over all code to this new API.
2014-05-16bus: fix unitialized variable access in error pathZbigniew Jędrzejewski-Szmek
2014-05-15sd-bus: always keep slot reference while dispatching callbackLennart Poettering
Also, make sure we automatically destroy reply callbacks that are floating.
2014-05-15sd-bus: introduce sd_bus_slot objects encapsulating callbacks or vtables ↵Lennart Poettering
attached to a bus connection This makes callback behaviour more like sd-event or sd-resolve, and creates proper object for unregistering callbacks. Taking the refernce to the slot is optional. If not taken life time of the slot will be bound to the underlying bus object (or in the case of an async call until the reply has been recieved).
2014-04-23bus: simplificationLennart Poettering
2014-03-19sd-bus: don't use assert_return() to check for disconnected bus connectionsLennart Poettering
A terminated connection is a runtime error and not a developer mistake, hence don't use assert_return() to check for it.
2014-03-19sd-bus: add proper monitoring APILennart Poettering
2014-02-20libsystemd: fix compiler warning in property_get_set_callbacks_run()Daniel Mack
gcc (4.8.2, arm) doesn't understand that vtable_property_get_userdata() will always set 'u' when it returns > 0. Hence, the warning is bogus, but anyway. src/libsystemd/sd-bus/bus-objects.c:510:19: warning: 'u' may be used uninitialized in this function [-Wmaybe-uninitialized] (and yes, indeed, even the reported line numbers are bogus in this case)
2014-02-20api: in constructor function calls, always put the returned object pointer ↵Lennart Poettering
first (or second) Previously the returned object of constructor functions where sometimes returned as last, sometimes as first and sometimes as second parameter. Let's clean this up a bit. Here are the new rules: 1. The object the new object is derived from is put first, if there is any 2. The object we are creating will be returned in the next arguments 3. This is followed by any additional arguments Rationale: For functions that operate on an object we always put that object first. Constructors should probably not be too different in this regard. Also, if the additional parameters might want to use varargs which suggests to put them last. Note that this new scheme only applies to constructor functions, not to all other functions. We do give a lot of freedom for those. Note that this commit only changes the order of the new functions we added, for old ones we accept the wrong order and leave it like that.
2014-01-21libsystemd: split up into subdirsTom Gundersen
We still only produce on .so, but let's keep the sources separate to make things a bit less messy.