1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 18:27:04 +03:00
Commit Graph

13275 Commits

Author SHA1 Message Date
Thomas Hindoe Paaboel Andersen
7c8e83c6d8 bus: remove unused variable 2013-12-01 00:26:08 +01:00
Thomas Hindoe Paaboel Andersen
27373e4427 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.
2013-12-01 00:14:28 +01:00
Thomas Hindoe Paaboel Andersen
a051da35ce sysfs-show.c: return negative error
introduced in 1ca208fb4f
2013-11-30 21:59:40 +01:00
Thomas Hindoe Paaboel Andersen
e5f476db05 macro.h: fix typo in comment 2013-11-30 21:55:35 +01:00
Kay Sievers
98a4025806 bus: catch up with kdbus 2013-11-30 20:41:02 +01:00
Lennart Poettering
626851be97 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.
2013-11-30 20:18:48 +01:00
Lennart Poettering
4734b89564 update TODO 2013-11-30 19:55:23 +01:00
Lennart Poettering
763e20e675 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.
2013-11-30 19:53:33 +01:00
Lennart Poettering
79f8d3d2ce 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
2013-11-30 19:47:46 +01:00
Daniel Mack
b57bdedc87 libsystemd-bus: sync kdbus.h 2013-11-30 19:23:16 +01:00
Lennart Poettering
9bd37b40fa nspawn: set up a kdbus namespace when starting a container 2013-11-30 16:36:46 +01:00
Lennart Poettering
3310dfd5bd bus: append unique and well known names to all messages unconditionally 2013-11-30 16:08:11 +01:00
Lennart Poettering
49b832c5b8 bus: include unique and well known names in credentials object 2013-11-30 14:46:14 +01:00
Kay Sievers
2377ae1ff6 bus: update kdbus.h 2013-11-30 14:14:39 +01:00
Daniel Mack
1d0e3c9884 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.
2013-11-30 13:31:04 +01:00
David Strauss
683fc3a448 bus-proxyd: Fix CLI help. --bus-path is also usable as -p. 2013-11-30 16:55:30 +10:00
Lennart Poettering
e3dd987cfc core: allocate a kdbus bus for each systemd instance, if we can 2013-11-30 03:53:42 +01:00
Lennart Poettering
32f464809e bus: whenever we notice the connection is terminated enter CLOSING state 2013-11-30 01:49:40 +01:00
Lennart Poettering
a43b9ca304 bus: synthesize local error reply when we cannot deliver a message to kdbus because the destination is unavailable 2013-11-30 01:02:51 +01:00
Lennart Poettering
7adc46fcce 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.
2013-11-30 00:21:06 +01:00
Lennart Poettering
dff55e5db3 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.
2013-11-30 00:21:06 +01:00
Kay Sievers
4efbd13a99 bus: revert attempts to make the integration-testing work
fa6ccbf423
  197941a8d5
  547708f59e
2013-11-29 23:55:09 +01:00
Kay Sievers
f252ff1742 rename stdio-bridge to bus-proxyd 2013-11-29 22:12:59 +01:00
Lennart Poettering
219728b31b bus: synthesize NameLost/NameAcquired from kernel messages on top if NameOwnerChange 2013-11-29 22:03:55 +01:00
Lennart Poettering
51502af33d bus: fix callback index when dispatching kernel messages 2013-11-29 22:03:55 +01:00
Lennart Poettering
7d22c71732 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.
2013-11-29 22:03:55 +01:00
Daniel Mack
3519d4c895 libsystemd-bus: sd_bus_request_name: use kdbus_translate_request_name_flags() 2013-11-29 22:01:34 +01:00
Daniel Mack
98f17eda0f libsystemd-bus: rename sd_bus_kernel_translate_request_name_flags
... to keep the namespace clean.
2013-11-29 22:01:34 +01:00
Daniel Mack
6018903565 libsystemd-bus: add kdbus support for sd_bus_get_owner() 2013-11-29 22:01:34 +01:00
Daniel Mack
87b522ae19 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.
2013-11-29 22:01:34 +01:00
Daniel Mack
c931748d20 libsystemd-bus: factor out DBus bits out of sd_bus_get_owner()
Just a preparation for upcoming kdbus support.
2013-11-29 22:01:34 +01:00
Kay Sievers
fa6ccbf423 bus: do not fail if "comm" information cannot be retrieved from /proc 2013-11-29 21:34:14 +01:00
Kay Sievers
c6dfb87f1d bus: fix size calculation for match data 2013-11-29 21:03:54 +01:00
Lennart Poettering
34a2c9e841 bus: when synthesizing messages locally, fill in a sender 2013-11-29 20:14:11 +01:00
Lennart Poettering
b5dda4d84a busctl: fix --help line breaks 2013-11-29 20:14:11 +01:00
Lennart Poettering
777d7a6123 kdbus: synthesize NameOwnerChange signals from kernel messages and support matches against NameOwnerChange 2013-11-29 20:14:11 +01:00
Lennart Poettering
a9ed78b0ca kdbus: add base enums for items 2013-11-29 20:14:11 +01:00
Kay Sievers
197941a8d5 bus: do not fail if task information cannot be retrieved from /proc 2013-11-29 19:46:59 +01:00
Lukasz Skalski
9bb058a1e0 libsystemd-bus: clean up bus-control.c file 2013-11-29 19:08:51 +01:00
Kay Sievers
547708f59e bus: do not fail if cgroup information cannot be retrieved from /proc 2013-11-29 18:57:06 +01:00
Kay Sievers
8bd54e897c libsystemd-bus: catch up with latest kdbus changes 2013-11-29 18:37:39 +01:00
Daniel Mack
ea1edeceb1 libsystemd-bus: follow kdbus renames
kdbus now has more generic names for the items it passes around. That
allows for usage from other contexts.
2013-11-29 18:10:36 +01:00
Marcel Holtmann
c6f3f5b4b3 hwdb: Update database of Bluetooth company identifiers 2013-11-29 07:31:39 -08:00
Daniel Mack
c58dea190c 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.
2013-11-29 16:27:30 +01:00
Daniel Mack
d21a7bb1a9 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.
2013-11-29 15:36:40 +01:00
Daniel Mack
71008e18a0 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
2013-11-29 14:06:50 +01:00
Daniel Mack
ed99569df8 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.
2013-11-29 14:06:50 +01:00
Daniel Mack
0253ddccbb 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.
2013-11-29 14:06:50 +01:00
Daniel Mack
b6bd53c1ee libsystemd-bus: make sd_bus_list_names return all connections, including unique names 2013-11-29 14:06:50 +01:00
Daniel Mack
b147398450 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.
2013-11-29 14:06:49 +01:00