b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
4afd3348c7506dd1d36305b7bcb9feb8952b9d6b |
|
27-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy
GLIB has recently started to officially support the gcc cleanup
attribute in its public API, hence let's do the same for our APIs.
With this patch we'll define an xyz_unrefp() call for each public
xyz_unref() call, to make it easy to use inside a
__attribute__((cleanup())) expression. Then, all code is ported over to
make use of this.
The new calls are also documented in the man pages, with examples how to
use them (well, I only added docs where the _unref() call itself already
had docs, and the examples, only cover sd_bus_unrefp() and
sd_event_unrefp()).
This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we
tend to call our destructors these days.
Note that this defines no public macro that wraps gcc's attribute and
makes it easier to use. While I think it's our duty in the library to
make our stuff easy to use, I figure it's not our duty to make gcc's own
features easy to use on its own. Most likely, client code which wants to
make use of this should define its own:
#define _cleanup_(function) __attribute__((cleanup(function)))
Or similar, to make the gcc feature easier to use.
Making this logic public has the benefit that we can remove three header
files whose only purpose was to define these functions internally.
See #2008. |
cf0fbc49e67b55f8d346fc94de28c90113505297 |
|
16-Nov-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
tree-wide: sort includes
Sort the includes accoding to the new coding style. |
7fc04b12e0129cfedca05b13068e9c3aa7c3c196 |
|
11-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: don't try to acquire connection selinux label unless selinux is actually enabled
Otherwise we might end up mistaking a SMACK label for an selinux label.
Also, fixes unexpect debug messages:
http://lists.freedesktop.org/archives/systemd-devel/2015-November/034913.html |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
15a5e95075a7f6007dd97b2a165c8ed16fe683df |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out printf() helpers to stdio-util.h |
ee104e11e303499a637c5cd8157bd12ad5cc116d |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
user-util: move UID/GID related macros from macro.h to user-util.h |
430f0182b72373145c839dbfe99d2382855cb8f8 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
src/basic: rename audit.[ch] → audit-util.[ch] and capability.[ch] → capability-util.[ch]
The files are named too generically, so that they might conflict with
the upstream project headers. Hence, let's add a "-util" suffix, to
clarify that this are just our utility headers and not any official
upstream headers. |
07630cea1f3a845c09309f197ac7c4f11edd3b62 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split our string related calls from util.[ch] into its own file string-util.[ch]
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.
This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.
Also touches a few unrelated include files. |
057171efc103ac76c60a2a0d277d8bbf25415c21 |
|
27-Aug-2015 |
David Herrmann <dh.herrmann@gmail.com> |
Revert "sd-bus: do not connect to dbus-1 socket when kdbus is available"
This reverts commit d4d00020d6ad855d65d31020fefa5003e1bb477f. The idea of
the commit is broken and needs to be reworked. We really cannot reduce
the bus-addresses to a single address. We always will have systemd with
native clients and legacy clients at the same time, so we also need both
addresses at the same time. |
19bee5c3674cda184443509b49b9415f599349ab |
|
27-Aug-2015 |
David Herrmann <dh.herrmann@gmail.com> |
sd-bus: rename bloom-tag to arg0-has
We use dashes in our bloom-tags. Make sure the newly introduced arg0has
tag uses the same style.
Note that the external dbus-tags don't use dashes, though. They are
defined in the spec and we need to keep compatibility there. |
eccd47c5beb72211ce33c9a33a1bb36366d43e22 |
|
25-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: introduce new match type "arg0has=" for matching arrays of strings
Previously, sd-bus inofficially already supported bus matches that
tested a string against an array of strings ("as"). This was done via an
enhanced way to interpret "arg0=" matches. This is problematic however,
since clients have no way to determine if their respective
implementation understood strv matches or not, thus allowing invalid
matches to be installed without a way to detect that.
This patch changes the logic to only allow such matches with a new
"arg0has=" syntax. This has the benefit that non-conforming
implementations will return a parse error and a client application may
thus efficiently detect support for the match type.
Matches of this type are useful for "udev"-like systems that "tag" objects
with a number of strings, and clients need to be able to match against
any of these "tags".
The name "has" takes inspiration from Python's ".has_key()" construct. |
1105ea51a85dd72e0067045d4f50cbb2c69eefc4 |
|
24-Aug-2015 |
David Herrmann <dh.herrmann@gmail.com> |
sd-bus: don't list activators as proper peers
If a connection passed KDBUS_HELLO_ACTIVATOR, it cannot do I/O on the
bus. Hence, we should not treat it as proper peer. To actually query it,
you have to explicitly ask for activators.
This makes kdbus in-line with what dbus-daemon does. |
d4d00020d6ad855d65d31020fefa5003e1bb477f |
|
11-Aug-2015 |
Kay Sievers <kay@vrfy.org> |
sd-bus: do not connect to dbus-1 socket when kdbus is available
We should not fall back to dbus-1 and connect to the proxy when kdbus
returns an error that indicates that kdbus is running but just does not
accept new connections because of quota limits or something similar.
Using is_kdbus_available() in libsystemd/ requires it to move from
shared/ to libsystemd/.
Based on a patch from David Herrmann:
https://github.com/systemd/systemd/pull/886 |
89c240e3a5de561ec7164507b41121aecc299b08 |
|
30-Jul-2015 |
David Herrmann <dh.herrmann@gmail.com> |
sd-bus: fix parsing of KDBUS_CMD_LIST
We *must not* assume that an entry returned by KDBUS_CMD_LIST only
carries a single KDBUS_ITEM_OWNED_NAME. Similarly, we already parse
multiple such items for message-metadata, so make sure we support the
same on KDBUS_CMD_LIST.
By relying on the kernel to return all names separately, we limit the
kernel API significantly. Stop this and let the kernel decide how to
return its data. |
d41eee127aca04203c37d0d3cfb45e18fb9e5329 |
|
20-Jul-2015 |
Namhyung Kim <namhyung@gmail.com> |
sd-bus: use isempty() consistently
Instead of open-coding, use isempty() to check NULL or empty string
for consistency. |
18458807574ec84f2bba4597ea5f8c925037d5f4 |
|
16-Jul-2015 |
David Herrmann <dh.herrmann@gmail.com> |
sd-bus: properly match ID changes
If the caller does not specify arg1 for NameOwnerChanged matches, we
really must take the ID from arg2 or arg3, if provided. They are
guaranteed to be identical to arg1 if either is supplied, but there is no
strict requiredment that arg1 is supplied. Hence, make sure to always
take the more restrictive match. Otherwise, we install rather wide
matches without anyone requiring them. |
1af5f746d569f013595bb16ca113741ee306f04a |
|
16-Jul-2015 |
David Herrmann <dh.herrmann@gmail.com> |
sd-bus: destination-matches cannot match NameOwnerChanged
Make sure we don't install NameOwnerChanged matches if the caller passed
a destination='' match (except if it is the broadcast address). Per spec,
all NameOwnerChanged signals are broadcasts.
Only the NameLost/NameAcquired signals are unicasts, but those are never
received through sd-bus. Instead, the bus-proxy synthesizes them and it
already installs proper matches for them. |
e1141a962239ef9ad2383a7f57ff151597a2b982 |
|
06-Jul-2015 |
David Herrmann <dh.herrmann@gmail.com> |
sd-bus: support matching on destination names
Right now, we never install destination matches on kdbus as the kernel did
not support MATCH rules on those. With the introduction of
KDBUS_ITEM_DST_ID we can now match on destination IDs, so add explicit
support for those.
This requires a recent kdbus module to work. However, there seems to be no
user-space that uses "Destination=''" matches, yet, so old kdbus modules
still work fine (we couldn't find any real user).
This is needed to match on unicast signals in bus-proxy. A followup will
add support for this. |
26589352b2c7c067da0917ce95d5b31657ee7446 |
|
10-Jun-2015 |
David Herrmann <dh.herrmann@gmail.com> |
bus: we now support path_namespace=/
Our bloom-filters support root-path matching. Make sure we properly add
the path_namespace= tag. |
a867b0022616511cceb02f801e7643427d9f3776 |
|
10-Jun-2015 |
David Herrmann <dh.herrmann@gmail.com> |
bus: fix arg0path= two-way matching
DBus spec clearly defines arg0path= to be a two-way matching. That is,
either the matcher or the matchee can be a prefix of the other to match.
This is not possible to implement with bloom-filters. Instead, we'd have
to add a separate filter for each prefix. This is non-trivial, though.
Hence, just skip the match for now and match locally. |
3c42e8b281b092b4d10f24c80e21d69b0f232b96 |
|
10-Jun-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: fix early exit when we lack all data in bus_get_owner_creds_dbus1() |
c4e6556c46cea1b7195cfb81c8cfab8342ebd852 |
|
10-Jun-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
sd-bus: store selinux context at connection time
This appears to be the right time to do it for SOCK_STREAM
unix sockets.
Also: condition bus_get_owner_creds_dbus1 was reversed. Split
it out to a separate variable for clarity and fix.
https://bugzilla.redhat.com/show_bug.cgi?id=1224211 |
45afd51974fb6a88c5b1fe0b325b7b20fd7b7449 |
|
26-May-2015 |
Torstein Husebø <torstein@huseboe.net> |
treewide: fix typos |
cfeaa44a09756a93a881f786678973d9b1e382db |
|
29-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: properly handle creds that are known but undefined for a process
A number of fields do not apply to all processes, including: there a
processes without a controlling tty, without parent process, without
service, user services or session. To distuingish these cases from the
case where we simply don't have the data, always return ENXIO for them,
while returning ENODATA for the case where we really lack the
information.
Also update the credentials dumping code to show this properly. Fields
that are known but do not apply are now shown as "n/a".
Note that this also changes some of the calls in process-util.c and
cgroup-util.c to return ENXIO for these cases. |
33c62dcbd78dd42603a0d8989a150e816e0414d9 |
|
23-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: when bus operations are to be executed on direct connections always fail
Also, don't consider this an loggable event, so that code that tries to
read creds from a direct connection, doesn't generate logs. |
1386e47db5d627ef29664fc8a28b1065dcb7f197 |
|
21-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: expose ppid field
kdbus has been passing us the ppid file for a while, actually make use
of it. |
15411c0cb1192799b37ec8f25d6f30e8d7292fc6 |
|
13-Mar-2015 |
David Herrmann <dh.herrmann@gmail.com> |
tree-wide: there is no ENOTSUP on linux
Replace ENOTSUP by EOPNOTSUPP as this is what linux actually uses. |
606303a93ea52a70ebba55bb3152820e630f2164 |
|
02-Mar-2015 |
Daniel Mack <daniel@zonque.org> |
sd-bus: sync kdbus.h (ABI break)
After some reconsideration, we decided to move the binary protocol
back to 64-bit wide UIDs and GIDs. After all, it should be possible
to redefine [gu]id_t to uint64_t and things should continue to
work. As we want to avoid such data types in kdbus.h, let's move
back to 64-bit values and be safe.
In sd-bus, we have to do a translation between uint64_t and gid_t
now for supplementary gids.
Some inline comments have also been updated in kdbus upstream. |
6ad4a4fc43e12c8c36f85abbb36e8791ec507519 |
|
24-Feb-2015 |
Daniel Mack <daniel@zonque.org> |
sd-bus: sync kdbus.h
Follow two small changes in the kdbus API:
* Flags are now returned in cmd->return_flags by KDBUS_CMD_NAME_ACQUIRE
* struct kdbus_item_list has been dropped. The information stored in
this struct was redundant since awhile already, as all commands
report their returned slice size anyway. |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use. |
00d053d3cacab6628405d704c5049274e1be297e |
|
19-Feb-2015 |
David Herrmann <dh.herrmann@gmail.com> |
bus: sync with kdbus.git (ABI break)
This syncs up the new KDBUS_CMD_CONN_INFO behavior:
- attach-flags are passed in .attach_flags, instead of directly merged
with the command flags. |
e044970a29b83e128c5a78f70e7d5ad1c74e7058 |
|
13-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: initialize a few structs at time or declaration |
b2086f601b313939db160aa028e66649ba81bd01 |
|
05-Feb-2015 |
David Herrmann <dh.herrmann@gmail.com> |
bus: sync with kdbus (ABI break) |
63c372cb9df3bee01e3bf8cd7f96f336bddda846 |
|
03-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
util: rework strappenda(), and rename it strjoina()
After all it is now much more like strjoin() than strappend(). At the
same time, add support for NULL sentinels, even if they are normally not
necessary. |
5ffa8c818120e35c89becd938d160235c069dd12 |
|
01-Feb-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Add a snprinf wrapper which checks that the buffer was big enough
If we scale our buffer to be wide enough for the format string, we
should expect that the calculation was correct.
char_array_0() invocations are removed, since snprintf nul-terminates
the output in any case.
A similar wrapper is used for strftime calls, but only in timedatectl.c. |
8facc3498ed037f842891ff55d1f60fe834f4ba0 |
|
22-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Fix some format strings for enums, they are signed |
21fce57b26f50381d21a22be4d62a8f6067dc5c9 |
|
18-Jan-2015 |
David Herrmann <dh.herrmann@gmail.com> |
bus: fix SD_BUS_CREDS_AUGMENT on kdbus queries
If we set SD_BUS_CREDS_AUGMENT, we *need* the PID from the kernel so we
can lookup further information from /proc. However, we *must* set
SD_BUS_CREDS_PIDS in "mask", otherwise, our creds-collector will never
actually copy the pid into "sd_bus_creds". Fix this, so
SD_BUS_CREDS_AUGMENT works even if SD_BUS_CREDS_PID is not specified by
the caller. |
eea0b59193f37fcc9ee227de26d0009e6bdc6d92 |
|
18-Jan-2015 |
David Herrmann <dh.herrmann@gmail.com> |
bus: fix typo
Fix comment typo and clarify that this is not about privileges but can
have rather arbitrary reasons. |
05bae4a60c32e29797597979cee2f3684eb3bc1e |
|
18-Jan-2015 |
David Herrmann <dh.herrmann@gmail.com> |
bus: use EUID over UID and fix unix-creds
Whenever a process performs an action on an object, the kernel uses the
EUID of the process to do permission checks and to apply on any newly
created objects. The UID of a process is only used if someone *ELSE* acts
on the process. That is, the UID of a process defines who owns the
process, the EUID defines what privileges are used by this process when
performing an action.
Process limits, on the other hand, are always applied to the real UID, not
the effective UID. This is, because a process has a user object linked,
which always corresponds to its UID. A process never has a user object
linked for its EUID. Thus, accounting (and limits) is always done on the
real UID.
This commit fixes all sd-bus users to use the EUID when performing
privilege checks and alike. Furthermore, it fixes unix-creds to be parsed
as EUID, not UID (as the kernel always takes the EUID on UDS). Anyone
using UID (eg., to do user-accounting) has to fall back to the EUID as UDS
does not transmit the UID. |
23539f67792d88c675b56cace0c22e022563493d |
|
08-Jan-2015 |
Lukasz Skalski <l.skalski@samsung.com> |
sd-bus: fix copy-paste error |
210a68826fac0f6525719cc6044c7858c655986a |
|
07-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: always catch name requests for the special names "org.freedesktop.DBus" and "org.freedesktop.DBus.Local" and refuse them |
34a5d5e52661212c7a145cbab45e70a6df7ba284 |
|
30-Dec-2014 |
David Herrmann <dh.herrmann@gmail.com> |
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. |
94e15fdc4d9d96fa6607bfb4eaaea164a3aec417 |
|
11-Dec-2014 |
David Herrmann <dh.herrmann@gmail.com> |
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. |
32802361561403cb6441198c82d9c499e0513863 |
|
09-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: get rid of PID starttime concept
As kdbus no longer exports this, remove all traces from sd-bus too |
96ceff428359b8f757d9d4da1f5da13bb9b5ab2e |
|
09-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: catch up with current kdbus, don't do matches on kdbus monitor connections |
0aa72be6a02e8bbcb364526b8e1904a94b81a547 |
|
08-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
bus-proxy: fix compat with autostarted services |
fed1e721fd0c81e60c77120539f34e16c2585634 |
|
28-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
treewide: introduce UID_INVALID (and friends) as macro for (uid_t) -1 |
52cfc0379a9d63f99cdb3d9f63c839bbc8889b4c |
|
28-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: rework credential query logic
Also, make the call to free kdbus slices generic and use it everywhere |
38ce47e262fbb76b6f6514e8e80cacfc584bee5a |
|
27-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: when we get the list of well-known names back from kdbus we shouldn't confuse the empty list with unknown information |
e12d81ae80214ef05ddedafd016bdd604ce17d12 |
|
26-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
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. |
b5dae4c7f77f7c87b91e0afb60a31c690dda4a1f |
|
26-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: add suppot for renegotiating message credential attach flags |
f3c0588651927ebac691130aa861b878fa22e527 |
|
26-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: use free_and_strdup() where appropriate
This simplifies things a bit and makes sure we free any previously set
creds component before writing in a new one. |
0258159049d5b381c6097533a69a1b29c3ba7ce2 |
|
25-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: add supplementary groups list to creds object |
becca6eaafa8ad7771363099f55b8a7dde516f21 |
|
25-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: properly handle uninitialized audit creds from kdbus |
359c09b1c1afa5a5ed4002940d7d6e61b74b7e3b |
|
25-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: don't fail when querying creds and dbus1 refuses to tell us the selinux context |
705a415f684f8e9ee19983e5859de00bbb1477cb |
|
25-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
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 |
e9730b76902af3fa831ccf0c50b05fba5b228e73 |
|
11-Nov-2014 |
Daniel Mack <daniel@zonque.org> |
sd-bus: pass attach flags to BUS_CREATOR_INFO
kdbus learned parsing the attach flags for the KDBUS_CMD_BUS_CREATOR_INFO
ioctl. Bits not set in this mask will not be exported. Set that field to
_KDBUS_ATTACH_ALL for now.
Signed-off-by: Daniel Mack <daniel@zonque.org> |
455971c1493fc6dc3125d235cf4ea6102cac626d |
|
04-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
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. |
635f9f0d95d1cc460f2c59a8fe26ecc358420544 |
|
04-Nov-2014 |
Daniel Mack <daniel@zonque.org> |
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 |
5ebe2ce782a5f4614b3381ba093cbebded3d3ce6 |
|
27-Oct-2014 |
Daniel Mack <daniel@zonque.org> |
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. |
505e77caa5cafce27b0dbfcf23e9b28315d167ae |
|
22-Oct-2014 |
Daniel Mack <daniel@zonque.org> |
sd-bus: fix transition left-overs in sd_bus_get_owner_creds()
sd_bus_get_owner_creds() was only halfly ported over to
_cleanup_bus_creds_unref_. |
8f44e3ea3e0821625e584938e54623e7fb381bb8 |
|
22-Oct-2014 |
Daniel Mack <daniel@zonque.org> |
sd-bus: implement sd_bus_get_owner_creds() for kdbus
kdbus learned a new ioctl to tell userspace about a bus creator's
credentials, which is what we need to implement sd_bus_get_owner_creds() for
kdbus.
Move the function from sd-bus.c to bus-control.c to be able to reuse
the bus_populate_creds_from_items() helper. |
056f95d0a70413e10e4a4ea9966baabb5a1450ed |
|
22-Oct-2014 |
Daniel Mack <daniel@zonque.org> |
sd-bus: rename sd_bus_get_owner_uid(), sd_bus_get_owner_machine_id() and sd_bus_get_peer_creds()
Clean up the function namespace by renaming the following:
sd_bus_get_owner_uid() → sd_bus_get_name_creds_uid()
sd_bus_get_owner_machine_id() → sd_bus_get_name_machine_id()
sd_bus_get_peer_creds() → sd_bus_get_owner_creds() |
370d7a9c0fe558c5846a2abd919e397639b69506 |
|
22-Oct-2014 |
Daniel Mack <daniel@zonque.org> |
sd-bus: factor out creds item iterator
We will re-use the code to walk items in order to populate a creds object,
so let's factor it out first. |
a1783d61a8a74dd91028cd065b8a23067419fe0a |
|
22-Oct-2014 |
Daniel Mack <daniel@zonque.org> |
sd-bus: sync kdbus.h
kdbus learned a new command to query a bus creator's credentials. Sync
kdbus.h first, which also renames some struct to more generic terms.
That is, however, not an ABI break this time. |
bc75205c773313a38a6958a6905a99bd56029196 |
|
21-Oct-2014 |
Daniel Mack <daniel@zonque.org> |
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. |
659b937e670a5cb423a274b97b1eb60abd7d218f |
|
20-Oct-2014 |
Lukasz Skalski <l.skalski@samsung.com> |
kdbus: free returned buffer when the memory is no longer needed |
4a3e79e1b6ac12b15efb46df0c42275376ee8e7b |
|
18-Oct-2014 |
Daniel Mack <daniel@zonque.org> |
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. |
82279e696605fe4eeadd1ca3744c76c8790f885b |
|
10-Oct-2014 |
Lukasz Skalski <l.skalski@samsung.com> |
kdbus: fix buffer overflow in bus_get_owner_kdbus() function
Commit 710fc9779b7c (kdbus repo) introduced attaching items[]
instead of name[] in kdbus_cmd_conn_info struct. Commit 581fe6c81
(systemd repo) caught up with this change, but item size was not
properly calculated. |
d663f1b1a92a778bcdc68f29b8c08cb49431b4f7 |
|
06-Oct-2014 |
Daniel Mack <daniel@zonque.org> |
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. |
581fe6c8176c6ea4ad998566df0746bf7b56456f |
|
02-Oct-2014 |
Daniel Mack <daniel@zonque.org> |
sd-bus: sync kdbus.h (ABI break)
struct kdbus_cmd_conn_info takes a list of items now instead of a string.
Fix the only user in SD of that ioctl. |
f0c5e28e58215682c832e1667b346b59c804f6a5 |
|
28-Sep-2014 |
Daniel Mack <daniel@zonque.org> |
sd-bus: clean up string length calculation
Move the +1 calculus onto the definition of the variable, just to make
the code a little easier to read. No functional change. |
619d7a039f9f64ffa593634c2715838ffbc17be4 |
|
23-Sep-2014 |
Daniel Mack <daniel@zonque.org> |
sd-bus: sync kdbus.h (API break)
Just a rename of two struct members to make the header file c++ compatible. |
f8c2425287c8362ae3a3c9acfb9e23a16862b38a |
|
22-Sep-2014 |
Daniel Mack <daniel@zonque.org> |
sd-bus: sync kdbus.h (API+ABI break)
The kdbus logic name registry logic was changed to transport the actual
name to acquire, release or report in a kdbus item.
This brings the name API a little more in line with other calls, and allows
for later augmentation.
Follow that change on the systemd side. |
7f3d3ba1a61f28a951ca5fbe59ed15c7ce55219c |
|
22-Sep-2014 |
David Herrmann <dh.herrmann@gmail.com> |
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. |
fe3f22d116f6f0cac3bdfa512ac54c0faf8bb7cd |
|
18-Aug-2014 |
Denis Kenzior <denkenz@gmail.com> |
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. |
b98490f7dc8372bcd3fa6dd54e3b62b6e365b609 |
|
15-May-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: fix an assert when running in kdbus mode |
9e7e9a6524a36be94d4c570eed324f46e5270240 |
|
15-May-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: don't hit assert when installing match |
26e376bfe34ba6caa04723b9200e9deace8e6c9f |
|
22-Apr-2014 |
Kay Sievers <kay@vrfy.org> |
bus: remove "on behalf" kdbus logic (ABI break) |
862bbf89c6e3db0a3ec265310eb6a92e0f1c375d |
|
10-Apr-2014 |
Kay Sievers <kay@vrfy.org> |
bus: catch up with kdbus changes (ABI break) |
a3d59cd1b0a2738d06893948492113f2c35be0af |
|
19-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: don't use assert_return() to check for disconnected bus connections
A terminated connection is a runtime error and not a developer mistake,
hence don't use assert_return() to check for it. |
09365592341b4ba4ceca677bb551dcde811e0333 |
|
19-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: add proper monitoring API |
6e18964d3a365567954fe10ddcfad74babdc427c |
|
04-Mar-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Introduce strv_consume which takes ownership
This mirrors set_consume and makes the common use a bit nicer. |
151b9b9662a90455262ce575a8a8ae74bf4ff336 |
|
20-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
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. |
39883f622f392d8579f4428fc5a789a102efbb10 |
|
19-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
make gcc shut up
If -flto is used then gcc will generate a lot more warnings than before,
among them a number of use-without-initialization warnings. Most of them
without are false positives, but let's make them go away, because it
doesn't really matter. |
b28ff39f42877daef31383748fd2f313d7fd67c1 |
|
28-Jan-2014 |
Lennart Poettering <lennart@poettering.net> |
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. |
18a281479dd6ea65d9b7471c5a74b78f23bef307 |
|
24-Jan-2014 |
Kay Sievers <kay@vrfy.org> |
bus: update kdbus.h (ABI break) |
eee9ec0e28922b6991a6eea64fd7ce54df1cd364 |
|
22-Jan-2014 |
Lennart Poettering <lennart@poettering.net> |
bus: change API to expose "inverted" no_reply and no_auto_start message flags non-inverted |
cccb0b2cdbd25e90ae92d2d5b107125cb1ca3433 |
|
22-Jan-2014 |
Lennart Poettering <lennart@poettering.net> |
bus: include connection name in credentials structure |
607553f9306286fdccf0b356bc3d1087adfe21c4 |
|
21-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
libsystemd: split up into subdirs
We still only produce on .so, but let's keep the sources separate to make things a bit
less messy. |