Commit graph

157 commits

Author SHA1 Message Date
David Herrmann 7ce9812173 bus: append bloom-filter to all signals
Make sure to append bloom-filters to all signal-messages, not only
broadcasts.
2015-01-09 00:53:30 +01:00
Lennart Poettering d29ae2914e sd-bus: unify how we set the sender of synthetic messages 2015-01-07 20:25:30 +01:00
Lennart Poettering 76877fb9cc sd-bus: make use of the newly added timestamps on kdbus kernel messages 2015-01-07 19:53:39 +01:00
Daniel Mack d7d052b23f sd-bus: sync kdbus.h
Catch up with latest changes in kdbus.ko:

 * Signals can be sent as unicast now, hence they need to be marked as
   such with the KDBUS_MSG_SIGNAL in the message flags.

 * Follow ioctl number change for KDBUS_CMD_FREE
2015-01-05 13:44:40 +01:00
David Herrmann 7d9fcc2bf6 bus: fix capabilities on big-endian
The kernel provides capabilities as a u32 array, sd-bus uses an u8 array.
This works fine on little-endian as both are encoded the same way.
However, this fails on big-endian if we do not perform sufficient
byte-swapping on each u32 entry.

This patch makes sd-bus use u32, too. We avoid changing any kernel
provided data so we can keep pointing into kdbus pool buffers which
contain u32 arrays.
2014-12-30 09:09:41 +01:00
David Herrmann 34a5d5e526 bus: drop creds->capability_size
The number of available caps can be read from
/proc/sys/kernel/cap_last_cap during runtime. Our helper cap_last_cap()
does that, so there's no reason to remember the size of any capability
cache. We can just pre-allocate arrays with a suitable size for all
available caps and reject any higher caps.

The kernel capability API uses u32 as base so make sure we do the same.
Note that this is specified by POSIX, so it's unlikely to change.
2014-12-30 08:42:53 +01:00
David Herrmann 315a73d97f bus: fix typo
Drop spurious 'we'.
2014-12-29 12:55:28 +01:00
Lennart Poettering 3c70e3bb02 core: rearrange code so that libsystemd/sd-bus/ does not include header files from core
Stuff in src/shared or src/libsystemd should *never* include code from
src/core or any of the tools, so don't do that here either. It's not OK!
2014-12-23 19:15:27 +01:00
Daniel Mack 856d6e0988 sd-bus: ignore KDBUS_ITEM_TIMESTAMP in kernel messages
Kernel notifications carry a timestamp now, so make sure
bus_kernel_translate_message() doesn't complain when it stumbles across
them.
2014-12-22 19:59:53 +01:00
David Herrmann 19ee32dc4d bus: send attach flags on BUS_MAKE
Make sure to set send-attach-flags on BUS_MAKE. These control which
information is revealed about the bus-owner.
2014-12-12 14:02:57 +01:00
David Herrmann 18ee085c15 bus: fix assert() on HELLO error-path
Make sure we don't call into any bus_kernel_*() functions before
b->is_kernel is set to true. Hard-code the CMD_FREE just like the other
helpers do.
2014-12-12 14:02:05 +01:00
David Herrmann d31f486b83 bus: sync with kdbus.git
Changes:
 * bloom parameters are returned in an offset via HELLO
 * FREE now takes items just like any other ioctl
2014-12-11 17:26:03 +01:00
David Herrmann 94e15fdc4d bus: sync with kdbus.git
Sync up with recent kdbus changed:
 * several ioctls gained .size and .items members (but still unused)
 * CMD_SEND gained its own ioctl structure
 * several members of kdbus_msg were dropped as they were only used during
   SEND, not during RECV etc.
 * CMD_RECV and CMD_SEND now share a kdbus_reply member which contains the
   offset and size of the returned message.
2014-12-11 13:19:41 +01:00
Lennart Poettering cb01aedc3b kdbus: downgrade warning if we cannot patch kdbus attach mask to DEBUG if kdbus is not available 2014-12-10 03:25:48 +01:00
Lennart Poettering 3280236156 sd-bus: get rid of PID starttime concept
As kdbus no longer exports this, remove all traces from sd-bus too
2014-12-09 18:16:54 +01:00
David Herrmann 77adde6382 bus: sync with kdbus-git (ABI break)
kdbus-git gained two new features:
 * memfd offsets: This allows to specify a 'start' offset in kdbus_memfd
                  so you can send partial memfd hunks instead of always
                  the full memfd
 * KDBUS_HELLO_UNPRIVILEGED: If passed during HELLO, the client will be
                             treated as unprivileged.
2014-12-09 11:14:55 +01:00
Daniel Mack 840ceb897f sd-bus: follow kdbus changes (ABI break)
Implement a recent change in the kdbus pool logic:

PAYLOAD_VEC_OFF items are now referencing offsets relative to the
connection's pool, not to the item itself. Follow this change in
sd-bus.
2014-12-05 10:04:02 +01:00
Lennart Poettering fed1e721fd treewide: introduce UID_INVALID (and friends) as macro for (uid_t) -1 2014-11-28 20:55:04 +01:00
Lennart Poettering 1abe54d9a9 sd-bus: add arrays of strings in the bloom filter
Let's do this right from the beginning, to prepare ground for udev
messages that most likely want to store list of strings (for device
tags) in messages, and filter on them.
2014-11-28 20:29:44 +01:00
Lennart Poettering 3acc1dafd1 sd-bus: add new call sd_bus_get_scope() for querying whether one is connected to a system or a user bus 2014-11-28 16:17:33 +01:00
Lennart Poettering 52cfc0379a sd-bus: rework credential query logic
Also, make the call to free kdbus slices generic and use it everywhere
2014-11-28 16:17:33 +01:00
Michal Schmidt da927ba997 treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values.
2014-11-28 13:29:21 +01:00
Michal Schmidt 0a1beeb642 treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all
low-level logging calls and intrdouce log_error_errno() as log calls
that take error numbers", use sed to convert the simple cases to use
the new macros:

find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/'

Multi-line log_*() invocations are not covered.
And we also should add log_unit_*_errno().
2014-11-28 12:04:41 +01:00
Lennart Poettering 1214b53c8e kdbus: when running in a container, don't complain that we cannot write to /sys 2014-11-28 03:16:56 +01:00
Lennart Poettering 412c18f10c sd-bus: the attach_mask kernel module parameter is 64bit now, hence initialize it as such 2014-11-28 02:25:45 +01:00
Lennart Poettering 1a29929959 kdbus: set kernel attach mask before creating the first bus 2014-11-27 22:05:24 +01:00
Lennart Poettering 38ce47e262 sd-bus: when we get the list of well-known names back from kdbus we shouldn't confuse the empty list with unknown information 2014-11-27 22:02:13 +01:00
Lennart Poettering 7d31d92400 sd-bus: unify logic how we patch the message source of driver messages 2014-11-27 22:02:12 +01:00
Lennart Poettering ac653862e0 sd-bus: fake valid well-known-names metadata for faked bus messages 2014-11-27 22:02:12 +01:00
Lennart Poettering 50c4521675 sd-bus: optimize how we generate the well-known-names lists in messages from kdbus 2014-11-27 22:02:12 +01:00
Lennart Poettering 7fa934b0d3 sd-bus: be stricter with mismatches between dbus1 and kdbus message headers 2014-11-27 22:02:12 +01:00
David Herrmann 342f3005f5 bus: prefix custom endpoints with "$UID-"
The kdbus module will later get a policy that endpoint-names are
restricted to "<uid>-<name>" just like bus-names. Make sure that systemd
is already compatible to that.
2014-11-27 13:49:41 +01:00
Lennart Poettering e12d81ae80 sd-bus: given that the kernel now passes the auxgroups list as 32bit array to us, no need to convert to uid_t manually
This way, we can save one allocation and avoid copying the array
unnecesarily.
2014-11-26 14:59:12 +01:00
David Herrmann affc7fe9e1 bus: update kdbus.h (ABI break)
We changed creds to u32, so fix systemd sd-bus to acknowledge that.
2014-11-26 11:11:54 +01:00
Lennart Poettering 38813cc824 bus-kernel: when installing an activator, ask for any kind of metadata to be attached to incoming messages
We don't know what the activated service might want in the end, hence
enable everything current and future, just to be sure.
2014-11-26 03:06:50 +01:00
Lennart Poettering 8aee3fc7ea sd-bus: don't clobber return values on failure in bus_kernel_open_bus_fd() 2014-11-26 03:06:50 +01:00
Lennart Poettering fa7796e97b sd-bus: set per-bus attach flag requirement mask to ANY
On the system and user busses we create it's the receiver that chooses
which metadata is attched, not the sender, hence set the requirement
mask to ANY, to allow any current of future credential bit to be
attached.
2014-11-26 03:06:50 +01:00
Lennart Poettering b5dae4c7f7 sd-bus: add suppot for renegotiating message credential attach flags 2014-11-26 02:20:55 +01:00
Lennart Poettering f9a458c666 sd-bus: react properly to EOVERFLOW by generating a log message about dropped broadcast messages and proceeding 2014-11-25 20:42:31 +01:00
Lennart Poettering 0a9f1fd79b kdbus: minor simplification 2014-11-25 19:25:19 +01:00
Lennart Poettering 9f6dfd0624 sd-bus: fix error handling when receiving invalid service name
Also, properly keep track of incoming additional service names.
2014-11-25 14:28:34 +01:00
Lennart Poettering 6dfcc64bb5 sd-bus: properly handle non-initialized audit records attached to incoming kernel messages 2014-11-25 14:28:34 +01:00
Lennart Poettering 0258159049 sd-bus: add supplementary groups list to creds object 2014-11-25 14:28:34 +01:00
Lennart Poettering 705a415f68 sd-bus: update to current kernel version, by splitting off the extended KDBUS_ITEM_PIDS structure from KDBUS_ITEM_CREDS
Also:

- adds support for euid, suid, fsuid, egid, sgid, fsgid fields.

- makes augmentation of creds with data from /proc explicitly
  controllable to give apps better control over this, given that this is
  racy.

- enables augmentation for kdbus connections (previously we only did it
  for dbus1). This is useful since with recent kdbus versions it is
  possible for clients to control the metadata they want to send.

- changes sd_bus_query_sender_privilege() to take the euid of the client
  into consideration, if known

- when we don't have permissions to read augmentation data from /proc,
  don't fail, just don't add the data in
2014-11-25 14:28:34 +01:00
Daniel Mack 63cc4c3138 sd-bus: sync with kdbus upstream (ABI break)
kdbus has seen a larger update than expected lately, most notably with
kdbusfs, a file system to expose the kdbus control files:

 * Each time a file system of this type is mounted, a new kdbus
   domain is created.

 * The layout inside each mount point is the same as before, except
   that domains are not hierarchically nested anymore.

 * Domains are therefore also unnamed now.

 * Unmounting a kdbusfs will automatically also detroy the
   associated domain.

 * Hence, the action of creating a kdbus domain is now as
   privileged as mounting a filesystem.

 * This way, we can get around creating dev nodes for everything,
   which is last but not least something that is not limited by
   20-bit minor numbers.

The kdbus specific bits in nspawn have all been dropped now, as nspawn
can rely on the container OS to set up its own kdbus domain, simply by
mounting a new instance.

A new set of mounts has been added to mount things *after* the kernel
modules have been loaded. For now, only kdbus is in this set, which is
invoked with mount_setup_late().
2014-11-13 20:41:52 +01:00
Daniel Mack 022fb8558e sd-bus: add sd_bus_message.verify_destination_id and .destination_ptr
kdbus learned to accept both a numerical destination ID as well as a
well-known-name. In that case, kdbus makes sure that the numerical ID is in
fact the owner of the provided name and fails otherwise.

This allows for race-free assertion of a bus name owner while sending a
message, which is a requirement for bus-proxyd.

Add two new fields to sd_bus_message, and set the numerical ID to
verify_destination_id if bus_message_setup_kmsg() is called for a
message with a well-known name.

Also, set the destination's name in the kdbus item to .destination_ptr
if it is non-NULL.

Normal users should not touch these fields, and they're not publicy
accessible.
2014-11-11 14:14:01 +01:00
Lennart Poettering 6f5c810ad6 sd-bus: by default allow all creds to be passed along 2014-11-05 18:54:50 +01:00
Daniel Mack d704fda934 sd-bus: sync up with new kdbus metadata attachment logic (ABI break)
The metadata logic in kdbus has seen a rework, and the only mandatory
change we have to follow for now is that attach_flags in kdbus_cmd_hello
is now split into two parts, attach_flags_send and attach_flags_recv.
2014-11-05 14:48:20 +01:00
Lennart Poettering 455971c149 sd-bus: rename "connection name" to "description" for the sd-bus API too
kdbus recently renamed this concept, and so should we in what we expose
in userspace.
2014-11-04 16:13:49 +01:00
Daniel Mack 635f9f0d95 sd-bus: sync kdbus.h (ABI break)
Catch up with some changes in kdbus.h:

  * KDBUS_{ITEM,ATTACH}_CONN_NAME were renamed to
    KDBUS_{ITEM,ATTACH}_CONN_DESCRIPTION, so the term 'name' is not
    overloaded as much.

  * The item types were re-ordered a little so they are lined up to the
    order of the corresponding KDBUS_ATTACH flags

  * A new item type KDBUS_ITEM_OWNED_NAME was introduced, designated to
    store a struct kdbus_name in item->name. KDBUS_ITEM_NAME soley
    stores data in item->str now

  * Some kerneldoc fixes
2014-11-04 12:44:53 +01:00
Tom Gundersen 6bcf0cf60c sd-bus: add missing include 2014-10-31 11:22:46 +01:00
Lennart Poettering 73843b5258 memfd: always use our internal utility functions where we have them 2014-10-30 18:28:37 +01:00
Lennart Poettering 45071fcaa0 memfd: always create our memfds with CLOEXEC set
We really shouldn't create fds ever that have the flag unset.
2014-10-30 16:23:34 +01:00
Daniel Mack 5ebe2ce782 sd-bus: sync kdbus.h (ABI break)
Some comment fixes and header cleanups in kdbus.h, and the task capability
meta information has been factored out to its own struct.
2014-10-27 17:02:31 +01:00
Daniel Mack b680a194bf sd-bus: assert clock_gettime()'s return value
Don't handle clock_gettime() errors gracefully but use assert_se().
2014-10-22 13:39:51 +02:00
Daniel Mack 03785ad0e5 sd-bus: sync kdbus.h (API change: switch to absolute timeouts)
kdbus_msg.timeout_ns now takes an absolute value, based on CLOCK_MONOTONIC,
in order to eventually support automatically restarted syscalls.

Signed-off-by: Daniel Mack <daniel@zonque.org>
2014-10-21 22:14:03 +02:00
Daniel Mack bc75205c77 sd-bus: sync kdbus.h (ABI break)
In kdbus.h, the following details changed:

 * All commands gained a 'kernel_flags' field to report the flags supported
   by the driver. Before, this was done in the 'flags' field in a
   bidirectional way, which turned out to be a problem for the code in
   sd-bus, as many parts of it reuse the same ioctl struct more than once
   and consider them to be owned by userspace.

 * Name listings are now returned by a new struct instead of reusing struct
   kdbus_cmd_name for that matter. This way, we don't add more unneeded
   fields to it and make the API cleaner.

 * 'conn_flags' was renamed to 'flags' in struct kdbus_cmd_hello to make
   the API a bit more unified.
2014-10-21 19:19:44 +02:00
Daniel Mack a2243d5488 sd-bus: sync kdbus.h (ABI break)
kdbus.h now has KDBUS_ATTACH_COMM split into KDBUS_ATTACH_TID_COMM and
KDBUS_ATTACH_PID_COMM. The items were split already, so the change in
systemd is easy.
2014-10-20 15:26:00 +02:00
Daniel Mack 4a3e79e1b6 sd-bus: sync kdbus.h (ABI break)
In kdbus.h, the 'features' field has been dropped again. Instead of
negotiating features that way, we decided to make the kernel return the
set of supported flags in each ioctl struct's .flags field, in both the
success and error cases.
2014-10-18 20:57:53 +02:00
Kay Sievers c32195e057 Revert "sd-bus: sync kdbus.h (ABI break)"
This reverts commit 1a2409e262.

Support from the kdbus interface was removed. We require
memfds to be supported by all clients.
2014-10-17 10:12:44 +02:00
Daniel Mack 1a2409e262 sd-bus: sync kdbus.h (ABI break)
kdbus learned KDBUS_HELLO_ACCEPT_MEMFD as new connection negotiation
flag. Set it by default in systemd for now.
2014-10-14 20:03:06 +02:00
Daniel Mack 40885bb29e sd-bus: sync kdbus.h (ABI break)
Sync kdbus.h once again. Two thing have changed:

 a) KDBUS_CMD_EP_* was renamed to KDBUS_CMD_ENDPOINT_*
 b) struct kdbus_cmd_hello and struct kdbus_cmd_make gained a
    'features' bitfield (which is currently unused)
2014-10-08 17:30:49 +02:00
Daniel Mack ca794c8e95 sd-bus: fix use-after-free in close_kdbus_msg()
Walk the items first, then free the memory of the message.

Also, while at it, make coverity happy with an explicit (void) prefix.
We intentionally ignore the return value here.
2014-10-07 11:38:31 +02:00
Thomas Hindoe Paaboel Andersen 13303f018d sd-bus: remove unused variable
It is no longer used after d663f1b1a9
2014-10-07 00:00:21 +02:00
Daniel Mack d663f1b1a9 sd-bus: sync kdbus.h (ABI break)
The KDBUS_CMD_FREE ioctl now uses a struct rather than a direct pointer
to the offset to free.

The KDBUS_CMD_MSG_CANCEL ioctl has also changes, but there's no user of
it yet in systemd.
2014-10-06 18:36:16 +02:00
Zbigniew Jędrzejewski-Szmek 125dd07483 sd-bus: split out cleanup into separate function
m is always non-null at this point. This function is too long anyway.
2014-10-03 20:42:09 -04:00
Lennart Poettering 2c652b6bfe kdbus: don't clobber return values, use strjoin() instead of asprintf(), keep function invocations and variable declarations separate 2014-10-02 20:38:00 +02:00
Lennart Poettering 8e00bfc234 kdbus: make sure we never invoke free() on an uninitialized pointer on OOM 2014-10-02 20:38:00 +02:00
Daniel Mack 619d7a039f sd-bus: sync kdbus.h (API break)
Just a rename of two struct members to make the header file c++ compatible.
2014-09-23 16:16:04 +02:00
David Herrmann 7f3d3ba1a6 bus: align kdbus ioctl parameters to 8byte
All kdbus ioctl arguments must be 8byte aligned. Make sure we use
alloca_align() and _alignas_(8) in all situations where gcc doesn't
guarantee 8-byte alignment.

Note that objects on the stack are always 8byte aligned as we put
_alignas_(8) into the structure definition in kdbus.h.
2014-09-22 14:27:02 +02:00
Cristian Rodríguez 4edf33d1e3 Fix resource leak (coverity CID 1237760) 2014-09-18 10:13:09 +02:00
Daniel Mack e7d718afdb bus: add code to create custom endpoints and set their policy
Custom endpoints are alternative connection points to a bus, allowing
specific policy to be uploaded.

Add two functions to bus-kernel. One to create such endpoints, and another
one for setting a policy for them.
2014-09-08 11:06:45 +02:00
Daniel Mack 5369c77d2e bus: factor out bus policy items
In order to re-use the policy definitions, factor them out into their own
files.
2014-09-08 11:06:45 +02:00
Lennart Poettering bb19cb1707 sd-bus: remove unused call bus_kernel_create_monitor()
Noticed by Djalal Harouni
2014-08-26 20:35:44 +02:00
Denis Kenzior fe3f22d116 bus-control: Fix cgroup handling
On systems without properly setup systemd, cg_get_root_path returns
-ENOENT.  This means that busctl doesn't display much information.

busctl monitor also fails whenever it intercepts messages.

This fix fakes creates a fake "/" root cgroup which lets busctl work
on such systems.
2014-08-18 21:01:57 +02:00
Daniel Mack 4632777024 memfd: fix memfd_create() syscall wrapper
Unlike earlier versions, the syscall only takes 2 arguments in its
final version, not 3.
2014-08-18 12:37:22 +02:00
Daniel Mack a6082d778e kdbus: switch over to generic memfd implementation (ABI+API break) 2014-08-17 21:47:00 +02:00
Zbigniew Jędrzejewski-Szmek 8f077bf94e Print kdbus path when opening fails
This makes it easier to debug what is going on.
2014-07-26 15:08:42 -04:00
Lennart Poettering a4152e3fe2 kdbus: when uploading bus name policy, resolve users/groups out-of-process
It's not safe invoking NSS from PID 1, hence fork off worker processes
that upload the policy into the kernel for busnames.
2014-06-05 13:09:46 +02:00
Zbigniew Jędrzejewski-Szmek de0671ee7f Remove unnecessary casts in printfs
No functional change expected :)
2014-05-15 15:29:58 +02:00
Lennart Poettering 0936559234 sd-bus: add proper monitoring API 2014-03-19 04:17:00 +01:00
Daniel Mack 5892a914d1 busname: introduce Activating directive
Add a new config 'Activating' directive which denotes whether a busname
is actually registered on the bus. It defaults to 'yes'.

If set to 'no', the .busname unit only uploads policy, which will remain
active as long as the unit is running.
2014-03-19 02:25:36 +01:00
Lennart Poettering d2e7b05f24 core: when creating an activating busname attach all metadata fields to the messages queued for it
This way we can be sure that the service the messages are ultimately
intended for finds all fields it might need.
2014-03-19 01:36:03 +01:00
Lennart Poettering 3f9da41645 core: add new AcceptFD= setting to .busname units
AcceptFD= defaults to true, thus making sure that by default fd passing
is enabled for all activatable names. Since for normal bus connections
fd passing is enabled too by default this makes sure fd passing works
correctly regardless whether a service is already activated or not.

Making this configurable on both busname units and in bus connections is
messy, but unavoidable since busnames are established and may queue
messages before the connection feature negotiation is done by the
service eventually activated. Conversely, feature negotiation on bus
connections takes place before the connection acquires its names.

Of course, this means developers really should make sure to keep the
settings in .busname units in sync with what they later intend to
negotiate.
2014-03-18 20:54:32 +01:00
Lennart Poettering 6340559506 test 2014-03-18 19:31:44 +01:00
Lennart Poettering 03e334a1c7 util: replace close_nointr_nofail() by a more useful safe_close()
safe_close() automatically becomes a NOP when a negative fd is passed,
and returns -1 unconditionally. This makes it easy to write lines like
this:

        fd = safe_close(fd);

Which will close an fd if it is open, and reset the fd variable
correctly.

By making use of this new scheme we can drop a > 200 lines of code that
was required to test for non-negative fds or to reset the closed fd
variable afterwards.
2014-03-18 19:31:34 +01:00
Josh Triplett f8294e4175 Use strlen even for constant strings
GCC optimizes strlen("string constant") to a constant, even with -O0.
Thus, replace patterns like sizeof("string constant")-1 with
strlen("string constant") where possible, for clarity.  In particular,
for expressions intended to add up the lengths of components going into
a string, this often makes it clearer that the expression counts the
trailing '\0' exactly once, by putting the +1 for the '\0' at the end of
the expression, rather than hidden in a sizeof in the middle of the
expression.
2014-03-16 09:52:56 -04:00
Lennart Poettering 42c4ebcbd4 sd-bus: don't look for a 64bit value when we only have 32bit value on reply cookie hash table access
This broke hashtable lookups for the message cookies on s390x, which is
a 64bit BE machine where accessing 32bit values as 64bit and vice versa
will explode.

Also, while we are at it, be a bit more careful when dealing with the
64bit cookies we expose and the 32bit serial numbers dbus uses in its
payload.

Problem identified by Fridrich Strba.
2014-03-13 20:33:22 +01:00
Lennart Poettering a6278b8830 bus: replace sd_bus_label_{escape,unescape}() by new sd_bus_path_{encode,decode}()
The new calls work similarly, but enforce a that a common, fixed bus
path prefix is used.

This follows discussions with Simon McVittie on IRC that it should be a
good idea to make sure that people don't use the escaping applied here
too wildly as anything other than the last label of a bus path.
2014-03-11 19:03:50 +01:00
Daniel Mack 1683342af1 sd-bus: add support for policy upload on activator connections
Activator connections may upload policy when registering to the bus.
This patch contains code to translate between BusNamePolicy objects and
the kdbus specific items.
2014-03-07 19:14:05 +01:00
Daniel Mack f7c7cd03d1 sd-bus: sync kdbus.h (ABI break)
Bring kdbus.h in sync with recent policy related changes. Most notably,
KDBUS_MAKE_POLICY_OPEN is now gone. The rest doesn't matter for systemd
at this point, as the policy functionality was not yet used.
2014-03-07 19:14:05 +01:00
Lennart Poettering 151b9b9662 api: in constructor function calls, always put the returned object pointer 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-02-20 00:03:10 +01:00
Jan Engelhardt 73e231abde doc: update punctuation
Resolve spotted issues related to missing or extraneous commas, dashes.
2014-02-17 19:03:07 -05:00
Kay Sievers 486e99a387 bus: update kdbus.h (ABI break) 2014-02-01 17:21:36 +01:00
Greg KH 29804cc1e0 use memzero(foo, length); for all memset(foo, 0, length); calls
In trying to track down a stupid linker bug, I noticed a bunch of
memset() calls that should be using memzero() to make it more "obvious"
that the options are correct (i.e. 0 is not the length, but the data to
set).  So fix up all current calls to memset(foo, 0, length) to
memzero(foo, length).
2014-01-31 11:55:01 +01:00
Lennart Poettering b28ff39f42 bus: rework bloom filter logic to operate with variable bloom filter
sizes and numbers of hash functions

In order to make the bloom filter logic more future proof communicate
bloom filter parameters from the original bus creator to the clients,
and allow them to be variable within certain ranges.
2014-01-28 00:57:38 +01:00
Lennart Poettering ff975efb2e bus: when we cannot bus activate a service because we go down, drop one
message from the queue
2014-01-27 20:12:59 +01:00
Kay Sievers 18a281479d bus: update kdbus.h (ABI break) 2014-01-24 17:49:32 +01:00
Lennart Poettering 766c580959 bus: add sd_bus_process_priority() to support prioq mode of kdbus 2014-01-22 20:26:58 +01:00
Lennart Poettering ca7b42c816 bus: expose priority field of messages, in preparation for prioq support 2014-01-22 20:01:23 +01:00