chiark / gitweb /
elogind.git
10 years agobus: internalize a lot of protocol definitions
Lennart Poettering [Tue, 3 Dec 2013 17:13:48 +0000 (18:13 +0100)]
bus: internalize a lot of protocol definitions

We shouldn export what isn't necessary or useful to clients, so let's
add the protocol definitions we only need internally into a private
header.

10 years agojournal: fail silently in sd_j_sendv() if journal is unavailable
Zbigniew Jędrzejewski-Szmek [Tue, 3 Dec 2013 13:07:32 +0000 (08:07 -0500)]
journal: fail silently in sd_j_sendv() if journal is unavailable

"syslog(3) and sd_journal_print() may largely be used interchangeably
functionality-wise" according to sd_journal_print(3). This socket
should be always available except in rare circumstatances, and we
don't random applications to fail on logging, so let's do what syslog
did. The alternative of forcing all callers to do error handling for
this rare case doesn't really have any benefits, since if they can't
log there isn't much they can do anyway.

https://bugzilla.redhat.com/show_bug.cgi?id=1023041

10 years agobus: make sd_bus_request_name() and sd_bus_release_name() behave more like other...
Lennart Poettering [Tue, 3 Dec 2013 17:01:26 +0000 (18:01 +0100)]
bus: make sd_bus_request_name() and sd_bus_release_name() behave more like other calls

Instead of returning an enum of return codes, make them return error
codes like kdbus does internally.

Also, document this behaviour so that clients can stick to it.

(Also rework bus-control.c to always have to functions for dbus1 vs.
kernel implementation of the various calls.)

10 years agomacro: better make IN_SET() macro use const arrays
Lennart Poettering [Tue, 3 Dec 2013 15:41:06 +0000 (16:41 +0100)]
macro: better make IN_SET() macro use const arrays

10 years agolibsystemd-bus: catch up with latest kdbus changes
Daniel Mack [Tue, 3 Dec 2013 13:38:53 +0000 (14:38 +0100)]
libsystemd-bus: catch up with latest kdbus changes

10 years agounits: ship busname units for the bus activated services we ship
Lennart Poettering [Tue, 3 Dec 2013 03:27:03 +0000 (04:27 +0100)]
units: ship busname units for the bus activated services we ship

10 years agocatalog: rename files to specify language in the filename
Zbigniew Jędrzejewski-Szmek [Tue, 3 Dec 2013 01:29:10 +0000 (20:29 -0500)]
catalog: rename files to specify language in the filename

10 years agocatalog: determine language from the filename
Zbigniew Jędrzejewski-Szmek [Tue, 3 Dec 2013 02:35:31 +0000 (21:35 -0500)]
catalog: determine language from the filename

10 years agosystemd: treat reload failure as failure
Zbigniew Jędrzejewski-Szmek [Tue, 3 Dec 2013 02:52:51 +0000 (21:52 -0500)]
systemd: treat reload failure as failure

systemctl reload "suceeded" on stopped units, but it is documented
to fail in this case.

https://bugzilla.redhat.com/show_bug.cgi?id=1036845

10 years agodbus1: make gcc shut up
Lennart Poettering [Tue, 3 Dec 2013 01:07:24 +0000 (02:07 +0100)]
dbus1: make gcc shut up

10 years agolibsystemd-bus: catch up with latest kdbus changes
Daniel Mack [Tue, 3 Dec 2013 00:56:13 +0000 (01:56 +0100)]
libsystemd-bus: catch up with latest kdbus changes

10 years agounits: create busnames.target for user sessions too
Lennart Poettering [Tue, 3 Dec 2013 00:44:24 +0000 (01:44 +0100)]
units: create busnames.target for user sessions too

10 years agodbus1: hook busnames.target into normal boot if kdbus is enabled
Lennart Poettering [Tue, 3 Dec 2013 00:41:02 +0000 (01:41 +0100)]
dbus1: hook busnames.target into normal boot if kdbus is enabled

10 years agobus: skip unit file generation for systemd itself
Lennart Poettering [Tue, 3 Dec 2013 00:24:39 +0000 (01:24 +0100)]
bus: skip unit file generation for systemd itself

10 years agounits: install busnames.target by default
Lennart Poettering [Tue, 3 Dec 2013 00:18:26 +0000 (01:18 +0100)]
units: install busnames.target by default

10 years agobus: add generator that turns old dbus1 activation files into .busname + .service...
Lennart Poettering [Tue, 3 Dec 2013 00:13:03 +0000 (01:13 +0100)]
bus: add generator that turns old dbus1 activation files into .busname + .service units

10 years agobus: add .busname unit type to implement kdbus-style bus activation
Lennart Poettering [Mon, 2 Dec 2013 22:30:19 +0000 (23:30 +0100)]
bus: add .busname unit type to implement kdbus-style bus activation

10 years agobus: make sure we check for "incompatible" flags negotiated with kernel kdbus
Lennart Poettering [Mon, 2 Dec 2013 22:31:41 +0000 (23:31 +0100)]
bus: make sure we check for "incompatible" flags negotiated with kernel kdbus

10 years agocore: extra paranoia when deserializing kdbus fd
Lennart Poettering [Mon, 2 Dec 2013 22:10:28 +0000 (23:10 +0100)]
core: extra paranoia when deserializing kdbus fd

10 years agomacro: add a macro to test whether a value is in a specified list
Lennart Poettering [Mon, 2 Dec 2013 22:08:25 +0000 (23:08 +0100)]
macro: add a macro to test whether a value is in a specified list

Introduce IN_SET() macro to nicely check whether a value a is one of a
few listed values.

This makes writing this:

        if (a == 1 || a == 7 || a == 8 || a == 9)

nicer, by allowing this:

        if (IN_SET(a, 1, 7, 8, 9))

This is particularly useful for state machine enums.

10 years agoUse assert_return in more of the public API
Thomas Hindoe Paaboel Andersen [Mon, 2 Dec 2013 21:42:01 +0000 (22:42 +0100)]
Use assert_return in more of the public API

10 years agolibsystemd-bus: catch up with latest kdbus changes
Daniel Mack [Mon, 2 Dec 2013 19:29:58 +0000 (20:29 +0100)]
libsystemd-bus: catch up with latest kdbus changes

10 years agonspawn: make sure /dev/kdbus in the container is world accessible
Lennart Poettering [Mon, 2 Dec 2013 18:59:15 +0000 (19:59 +0100)]
nspawn: make sure /dev/kdbus in the container is world accessible

10 years agonspawn: make kdbus namespaces actually work
Lennart Poettering [Mon, 2 Dec 2013 17:47:39 +0000 (18:47 +0100)]
nspawn: make kdbus namespaces actually work

10 years agobusctl: add command to dump creds of a peer or pid
Lennart Poettering [Mon, 2 Dec 2013 17:40:19 +0000 (18:40 +0100)]
busctl: add command to dump creds of a peer or pid

(also, rename _SD_BUS_CREDS_MAX to _SD_BUX_CRED_ALL, since "MAX" so far
was used to indicate one higher than the highest valid value, and this
is not correct here.)

10 years agoDisplay synthetic message serial number in a more readable format than (uint32_t) -1
Lukasz Skalski [Mon, 2 Dec 2013 15:31:46 +0000 (16:31 +0100)]
Display synthetic message serial number in a more readable format than (uint32_t) -1

Serial=4294967295 field in message dump generated by bus_message_dump()
function for synthetic messages isn't good readable.

10 years agobus: be nice to LLVM and don't embedd a VLA in a union
Lennart Poettering [Mon, 2 Dec 2013 16:17:29 +0000 (17:17 +0100)]
bus: be nice to LLVM and don't embedd a VLA in a union

10 years agobus: when replying to an incoming message and the vtable contains the expected return...
Lennart Poettering [Mon, 2 Dec 2013 14:28:20 +0000 (15:28 +0100)]
bus: when replying to an incoming message and the vtable contains the expected return signature generate an error if the response message doesn't match it

10 years agoservice: remove unneccesary Socket.got_socket_fd
Shawn Landden [Wed, 20 Nov 2013 08:35:04 +0000 (00:35 -0800)]
service: remove unneccesary Socket.got_socket_fd

10 years agobuild-sys: allow building systemctl with --disable-logind
Marcel Holtmann [Sun, 1 Dec 2013 20:28:32 +0000 (12:28 -0800)]
build-sys: allow building systemctl with --disable-logind

When logind is disabled, do not attempt to link against the non-existing
libsystemd-login-internal.la library.

10 years agobus: bus_open_user_systemd() fall back to bus if runtime dir is not set
Kay Sievers [Sun, 1 Dec 2013 17:17:21 +0000 (18:17 +0100)]
bus: bus_open_user_systemd() fall back to bus if runtime dir is not set

10 years agocatalog,po: add Italian translation
Daniele Medri [Thu, 28 Nov 2013 17:58:55 +0000 (18:58 +0100)]
catalog,po: add Italian translation

10 years agoutil: add greedy_realloc0()
David Herrmann [Sat, 30 Nov 2013 10:31:59 +0000 (11:31 +0100)]
util: add greedy_realloc0()

Compared to greedy_realloc(), this sets all newly allocated memory to 0.
As the old variant has been used a lot for string-handling, we avoid
changing it as clearing memory is not needed there.

10 years agologind: fix "CanGraphical" attribute to return correct value
David Herrmann [Sat, 30 Nov 2013 10:37:32 +0000 (11:37 +0100)]
logind: fix "CanGraphical" attribute to return correct value

We should return seat_can_graphical() instead of seat_can_tty() for the
public dbus CanGraphical attribute. This used to work, but the
dbus -> sd-bus conversion introduced this regression.

10 years agofix regression of read_full_file() in fileio.c
Shawn Landden [Sun, 1 Dec 2013 04:02:27 +0000 (20:02 -0800)]
fix regression of read_full_file() in fileio.c

my e93c33d4aa broke this stupidly

10 years agoshell-completion: systemctl cat
Zbigniew Jędrzejewski-Szmek [Sun, 1 Dec 2013 03:31:31 +0000 (22:31 -0500)]
shell-completion: systemctl cat

Also update -H help string to follow the binaries.

10 years agosystemctl: do not show SourcePath when FragmentPath cannot be found
Zbigniew Jędrzejewski-Szmek [Sun, 1 Dec 2013 03:29:33 +0000 (22:29 -0500)]
systemctl: do not show SourcePath when FragmentPath cannot be found

Those files can be in a completely deferent format and also
arbitrarily long, and usually contain information about other
stuff. If we ever add SourceLine= or SourceLines= in addition
to SourcePath=, and can show the relevant information only, this
commit can be reverted.

10 years agosystemctl: add "systemctl cat"
Shawn Landden [Sun, 1 Dec 2013 00:09:26 +0000 (16:09 -0800)]
systemctl: add "systemctl cat"

10 years agosystemctl: refactor show()
Shawn Landden [Sun, 24 Nov 2013 03:52:52 +0000 (19:52 -0800)]
systemctl: refactor show()

v2, don't leave in unused function

10 years agoman: explicitly say when multiple units can be specified
Zbigniew Jędrzejewski-Szmek [Sun, 1 Dec 2013 02:23:01 +0000 (21:23 -0500)]
man: explicitly say when multiple units can be specified

itistoday> how do you specify multiple dependencies in a unit file? i've been
           googling and can't find this basic thing :-\
itistoday> do you use a comma, or use multiple After= statements?

10 years agodocs: remove unneeded the's in gudev docs
Zbigniew Jędrzejewski-Szmek [Sun, 1 Dec 2013 01:27:54 +0000 (20:27 -0500)]
docs: remove unneeded the's in gudev docs

https://bugs.freedesktop.org/show_bug.cgi?id=72164

10 years agobus: remove unused variable
Zbigniew Jędrzejewski-Szmek [Sun, 1 Dec 2013 01:10:18 +0000 (20:10 -0500)]
bus: remove unused variable

10 years agobus: remove unused variable
Thomas Hindoe Paaboel Andersen [Sat, 30 Nov 2013 23:26:08 +0000 (00:26 +0100)]
bus: remove unused variable

10 years agoutil.c: check if return value from ttyname_r is > 0 instead of != 0
Thomas Hindoe Paaboel Andersen [Sat, 30 Nov 2013 22:45:31 +0000 (23:45 +0100)]
util.c: check if return value from ttyname_r is > 0 instead of != 0

We must return a negative error code from getttyname_malloc but
that would not be the case if ttyname_r returned a negative value.

ttyname_r should only return EBADF, ENOTTY, or ERANGE so it should
be safe to change.

10 years agosysfs-show.c: return negative error
Thomas Hindoe Paaboel Andersen [Sat, 30 Nov 2013 20:59:40 +0000 (21:59 +0100)]
sysfs-show.c: return negative error

introduced in 1ca208fb4f93e5869704af1812cbff7130a2fc03

10 years agomacro.h: fix typo in comment
Thomas Hindoe Paaboel Andersen [Sat, 30 Nov 2013 20:55:35 +0000 (21:55 +0100)]
macro.h: fix typo in comment

10 years agobus: catch up with kdbus
Kay Sievers [Sat, 30 Nov 2013 19:41:02 +0000 (20:41 +0100)]
bus: catch up with kdbus

10 years agobus: do kdbus only if this is enabled on the configure switch
Lennart Poettering [Sat, 30 Nov 2013 19:18:48 +0000 (20:18 +0100)]
bus: do kdbus only if this is enabled on the configure switch

Since we want to retain the ability to break kernel ←→ userspace ABI
after the next release, let's not make use by default of kdbus, so that
people with future kernels will not suddenly break with current systemd
versions.

kdbus support is left in all builds but must now be explicitly requested
at runtime (for example via setting $DBUS_SESSION_BUS). Via a configure
switch the old behaviour can be restored. In fact, we change autogen.sh
to do this, so that git builds (which run autogen.sh) get kdbus by
default, but tarball builds (which ue the configure defaults) do not get
it, and hence this stays out of the distros by default.

10 years agoupdate TODO
Lennart Poettering [Sat, 30 Nov 2013 18:55:23 +0000 (19:55 +0100)]
update TODO

10 years agobus: use "System.Error." as prefix for implicit errno bus errors
Lennart Poettering [Sat, 30 Nov 2013 18:53:33 +0000 (19:53 +0100)]
bus: use "System.Error." as prefix for implicit errno bus errors

We probably shouldn't use "Posix.Error" since many of the errors have
nothing to do with Posix.

10 years agobus: support temporarily const errors that don't need to be freed but require deep...
Lennart Poettering [Sat, 30 Nov 2013 18:45:32 +0000 (19:45 +0100)]
bus: support temporarily const errors that don't need to be freed but require deep copies

This should fix issues with incorrectly copying bus error messages out
of sd_bus_message objects.

Original bug found by: Djalal Harouni

10 years agolibsystemd-bus: sync kdbus.h
Daniel Mack [Sat, 30 Nov 2013 18:23:16 +0000 (19:23 +0100)]
libsystemd-bus: sync kdbus.h

10 years agonspawn: set up a kdbus namespace when starting a container
Lennart Poettering [Sat, 30 Nov 2013 15:36:46 +0000 (16:36 +0100)]
nspawn: set up a kdbus namespace when starting a container

10 years agobus: append unique and well known names to all messages unconditionally
Lennart Poettering [Sat, 30 Nov 2013 15:08:11 +0000 (16:08 +0100)]
bus: append unique and well known names to all messages unconditionally

10 years agobus: include unique and well known names in credentials object
Lennart Poettering [Sat, 30 Nov 2013 03:14:10 +0000 (04:14 +0100)]
bus: include unique and well known names in credentials object

10 years agobus: update kdbus.h
Kay Sievers [Sat, 30 Nov 2013 13:14:39 +0000 (14:14 +0100)]
bus: update kdbus.h

10 years agolibsystemd-bus: catch up with latest kdbus changes
Daniel Mack [Sat, 30 Nov 2013 12:31:04 +0000 (13:31 +0100)]
libsystemd-bus: catch up with latest kdbus changes

The name list and query functions now work differently in kdbus, as the
result is stored in the connection's pool, rather than being copied back
through the ioctl buffer. That also safes us some logic, as we don't
have to resize the communication buffer in a loop with growing buffer
sizes.

Due to this, KDBUS_CMD_MSG_RELEASE was renamed to KDBUS_CMD_FREE, as it
is now used outside the message logic as well.

10 years agobus-proxyd: Fix CLI help. --bus-path is also usable as -p.
David Strauss [Sat, 30 Nov 2013 06:55:30 +0000 (16:55 +1000)]
bus-proxyd: Fix CLI help. --bus-path is also usable as -p.

10 years agocore: allocate a kdbus bus for each systemd instance, if we can
Lennart Poettering [Sat, 30 Nov 2013 02:53:42 +0000 (03:53 +0100)]
core: allocate a kdbus bus for each systemd instance, if we can

10 years agobus: whenever we notice the connection is terminated enter CLOSING state
Lennart Poettering [Sat, 30 Nov 2013 00:49:40 +0000 (01:49 +0100)]
bus: whenever we notice the connection is terminated enter CLOSING state

10 years agobus: synthesize local error reply when we cannot deliver a message to kdbus because...
Lennart Poettering [Sat, 30 Nov 2013 00:02:51 +0000 (01:02 +0100)]
bus: synthesize local error reply when we cannot deliver a message to kdbus because the destination is unavailable

10 years agobus: don't generate NameAcquired/NameLost messages in the library
Lennart Poettering [Fri, 29 Nov 2013 23:19:01 +0000 (00:19 +0100)]
bus: don't generate NameAcquired/NameLost messages in the library

The signals appear entirely redundant due to NameOwnerChange, hence
don't do them in the new library, instead leave them for the
compatibility bridge only.

Also, set the serial number for synthesized messages to (uint32_t) -1.

10 years agobuild-sys: no longer rebuild various bits and pieces such as man pages each time...
Lennart Poettering [Fri, 29 Nov 2013 23:16:49 +0000 (00:16 +0100)]
build-sys: no longer rebuild various bits and pieces such as man pages each time the Makefile changes

We don't do this for .c files either, even they are also influence quite
a bit by makefile settings. Given that XSLT is a lot slower then the
rest of the build let's make our build a bit faster if people end up
touching the Makefile.

10 years agobus: revert attempts to make the integration-testing work
Kay Sievers [Fri, 29 Nov 2013 22:55:09 +0000 (23:55 +0100)]
bus: revert attempts to make the integration-testing work

  fa6ccbf42360cdd794ae3164b76e0cc8f0bd62de
  197941a8d5d74d79ca45ae73ec114939a8e88244
  547708f59edd73d98edcbe84e95b41f7b3321f3b

10 years agorename stdio-bridge to bus-proxyd
Kay Sievers [Fri, 29 Nov 2013 20:54:44 +0000 (21:54 +0100)]
rename stdio-bridge to bus-proxyd

10 years agobus: synthesize NameLost/NameAcquired from kernel messages on top if NameOwnerChange
Lennart Poettering [Fri, 29 Nov 2013 21:02:43 +0000 (22:02 +0100)]
bus: synthesize NameLost/NameAcquired from kernel messages on top if NameOwnerChange

10 years agobus: fix callback index when dispatching kernel messages
Lennart Poettering [Fri, 29 Nov 2013 21:02:14 +0000 (22:02 +0100)]
bus: fix callback index when dispatching kernel messages

10 years agobus: add the ability for backends to queue to input messages at the same time
Lennart Poettering [Fri, 29 Nov 2013 20:29:16 +0000 (21:29 +0100)]
bus: add the ability for backends to queue to input messages at the same time

We need this so that one incoming kernel message can result in two
high-level bus messages, for the case where we synthesize NameAcquired
and NameOwnerChanged in the same instance.

10 years agolibsystemd-bus: sd_bus_request_name: use kdbus_translate_request_name_flags()
Daniel Mack [Fri, 29 Nov 2013 20:58:39 +0000 (21:58 +0100)]
libsystemd-bus: sd_bus_request_name: use kdbus_translate_request_name_flags()

10 years agolibsystemd-bus: rename sd_bus_kernel_translate_request_name_flags
Daniel Mack [Fri, 29 Nov 2013 20:14:07 +0000 (21:14 +0100)]
libsystemd-bus: rename sd_bus_kernel_translate_request_name_flags

... to keep the namespace clean.

10 years agolibsystemd-bus: add kdbus support for sd_bus_get_owner()
Daniel Mack [Fri, 29 Nov 2013 19:44:10 +0000 (20:44 +0100)]
libsystemd-bus: add kdbus support for sd_bus_get_owner()

10 years agolibsystemd-bus: add sd_bus_translate_attach_flags()
Daniel Mack [Fri, 29 Nov 2013 16:21:39 +0000 (17:21 +0100)]
libsystemd-bus: add sd_bus_translate_attach_flags()

Factor out code from sd_bus_negotiate_attach_creds() to a generic
translate function, so it can be used from other places.

10 years agolibsystemd-bus: factor out DBus bits out of sd_bus_get_owner()
Daniel Mack [Fri, 29 Nov 2013 15:52:06 +0000 (16:52 +0100)]
libsystemd-bus: factor out DBus bits out of sd_bus_get_owner()

Just a preparation for upcoming kdbus support.

10 years agobus: do not fail if "comm" information cannot be retrieved from /proc
Kay Sievers [Fri, 29 Nov 2013 20:34:14 +0000 (21:34 +0100)]
bus: do not fail if "comm" information cannot be retrieved from /proc

10 years agobus: fix size calculation for match data
Kay Sievers [Fri, 29 Nov 2013 20:03:54 +0000 (21:03 +0100)]
bus: fix size calculation for match data

10 years agobus: when synthesizing messages locally, fill in a sender
Lennart Poettering [Fri, 29 Nov 2013 19:10:08 +0000 (20:10 +0100)]
bus: when synthesizing messages locally, fill in a sender

10 years agobusctl: fix --help line breaks
Lennart Poettering [Fri, 29 Nov 2013 19:08:54 +0000 (20:08 +0100)]
busctl: fix --help line breaks

10 years agokdbus: synthesize NameOwnerChange signals from kernel messages and support matches...
Lennart Poettering [Fri, 29 Nov 2013 19:07:56 +0000 (20:07 +0100)]
kdbus: synthesize NameOwnerChange signals from kernel messages and support matches against NameOwnerChange

10 years agokdbus: add base enums for items
Lennart Poettering [Fri, 29 Nov 2013 19:09:41 +0000 (20:09 +0100)]
kdbus: add base enums for items

10 years agobus: do not fail if task information cannot be retrieved from /proc
Kay Sievers [Fri, 29 Nov 2013 18:46:59 +0000 (19:46 +0100)]
bus: do not fail if task information cannot be retrieved from /proc

10 years agolibsystemd-bus: clean up bus-control.c file
Lukasz Skalski [Fri, 29 Nov 2013 16:57:00 +0000 (17:57 +0100)]
libsystemd-bus: clean up bus-control.c file

10 years agobus: do not fail if cgroup information cannot be retrieved from /proc
Kay Sievers [Fri, 29 Nov 2013 17:57:06 +0000 (18:57 +0100)]
bus: do not fail if cgroup information cannot be retrieved from /proc

10 years agolibsystemd-bus: catch up with latest kdbus changes
Kay Sievers [Fri, 29 Nov 2013 17:37:39 +0000 (18:37 +0100)]
libsystemd-bus: catch up with latest kdbus changes

10 years agolibsystemd-bus: follow kdbus renames
Daniel Mack [Fri, 29 Nov 2013 17:10:36 +0000 (18:10 +0100)]
libsystemd-bus: follow kdbus renames

kdbus now has more generic names for the items it passes around. That
allows for usage from other contexts.

10 years agohwdb: Update database of Bluetooth company identifiers
Marcel Holtmann [Fri, 29 Nov 2013 15:26:47 +0000 (07:26 -0800)]
hwdb: Update database of Bluetooth company identifiers

10 years agolibsystemd-bus: copy over kdbus provided 128-bit bus id
Daniel Mack [Fri, 29 Nov 2013 15:24:40 +0000 (16:24 +0100)]
libsystemd-bus: copy over kdbus provided 128-bit bus id

kdbus now copies the bus unique id back to userspace in the hello
ioctl(). Use these bytes to set the server id of the sd_bus.

10 years agolibsystemd-bus: catch up with latest kdbus changes
Daniel Mack [Fri, 29 Nov 2013 14:36:37 +0000 (15:36 +0100)]
libsystemd-bus: catch up with latest kdbus changes

kdbus_cmd_hello now has a new uint64_t flags field for the requested
attachments. Follow that change in libsystemd-bus.

10 years agosystemd-stdio-bridge: make it socket-activatable and usable as kdbus bridge
Daniel Mack [Fri, 15 Nov 2013 17:05:27 +0000 (18:05 +0100)]
systemd-stdio-bridge: make it socket-activatable and usable as kdbus bridge

Augment systemd-stdio-bridge a bit to make it a 1:1 bridge from legacy
DBus clients to kdbus. In particular,

 * allow setting the bus path of the upstream bus as command line
   argument
 * use sd_listen_fds() for systemd's socket activation
 * omit calling sd_bus_negotiate_fds() when upstream bus is kdbus
 * reply to bus send errors with proper dbus error messages
 * treat -ECONNRESET as expected end-of-connection condition

10 years agolibsystemd-bus: sd_bus_request_name: fix return value for kdbus
Daniel Mack [Tue, 26 Nov 2013 16:24:18 +0000 (17:24 +0100)]
libsystemd-bus: sd_bus_request_name: fix return value for kdbus

kdbus returns -EALREADY if the requesting connection is already the
owner of a name, and -EEXIST if the name already exists and the
connection is not able to take it over.

Also, n->flags needs a translation as well to match the SD_BUS_* enum
values.

10 years agolibsystemd-bus: kernel: add sd_bus_kernel_translate_request_name_flags
Daniel Mack [Tue, 26 Nov 2013 15:45:50 +0000 (16:45 +0100)]
libsystemd-bus: kernel: add sd_bus_kernel_translate_request_name_flags

Flags used to request a name from kdbus are not identical to what DBus
and sd_bus use internally. Introduce a simple function to do the
translation for us. It's factored out to a separate function so the
dbus-driver instance can make use of it as well.

10 years agolibsystemd-bus: make sd_bus_list_names return all connections, including unique names
Daniel Mack [Tue, 19 Nov 2013 15:33:05 +0000 (16:33 +0100)]
libsystemd-bus: make sd_bus_list_names return all connections, including unique names

10 years agolibsystemd-bus: add kdbus support for sd_bus_list_names()
Daniel Mack [Fri, 15 Nov 2013 15:04:32 +0000 (16:04 +0100)]
libsystemd-bus: add kdbus support for sd_bus_list_names()

kdbus will tell us the minimum buffer size it needs in case the default
8kb buffer doesn't suffice.

10 years agolibsystemd-bus: bring definitions in sync with kdbus
Daniel Mack [Fri, 15 Nov 2013 14:55:27 +0000 (15:55 +0100)]
libsystemd-bus: bring definitions in sync with kdbus

In particular, KDBUS_ITEM_NEXT is now called KDBUS_PART_NEXT, and
KDBUS_ITEM_FOREACH was renamed to KDBUS_PART_FOREACH and takes one more
argument to make it more flexible.

10 years agobus: when turning a buffer into a sd_bus_message avoid creating zero-length parts
Lennart Poettering [Fri, 29 Nov 2013 12:34:16 +0000 (13:34 +0100)]
bus: when turning a buffer into a sd_bus_message avoid creating zero-length parts

10 years agoRevert "build-sys: avoid warnings from assert_cc"
Lennart Poettering [Fri, 29 Nov 2013 01:09:58 +0000 (02:09 +0100)]
Revert "build-sys: avoid warnings from assert_cc"

This reverts commit f1a1264d13b31b9f5521f482d9a5a9d78da55efb.

We can turn this off with a pragma only on old gcc. Newer gcc doesn't
need this, so let's not turn this off for everybody.

10 years agobus: creds - ignore EINVAL when acessing the (inactive) LSM /proc interface
Kay Sievers [Fri, 29 Nov 2013 10:52:22 +0000 (11:52 +0100)]
bus: creds - ignore EINVAL when acessing the (inactive) LSM /proc interface

10 years agobus: Add KDBUS_MSG_SRC_NAMES to bus_kernel_make_message() function
Lukasz Skalski [Fri, 29 Nov 2013 10:37:10 +0000 (11:37 +0100)]
bus: Add KDBUS_MSG_SRC_NAMES to bus_kernel_make_message() function

10 years agobusctl: drop bus driver name from list of services
Lennart Poettering [Thu, 28 Nov 2013 19:43:25 +0000 (20:43 +0100)]
busctl: drop bus driver name from list of services

10 years agobus: merge sd_bus_get_owner() and sd_bus_get_owner_creds() into one call
Lennart Poettering [Thu, 28 Nov 2013 19:41:55 +0000 (20:41 +0100)]
bus: merge sd_bus_get_owner() and sd_bus_get_owner_creds() into one call

Since the backing ioctl for this on kdbus is the same we retain
atomicity this way.

10 years agoRemove some unused variables
Zbigniew Jędrzejewski-Szmek [Thu, 28 Nov 2013 19:20:07 +0000 (14:20 -0500)]
Remove some unused variables