summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-03-18 20:54:32 +0100
committerLennart Poettering <lennart@poettering.net>2014-03-18 20:54:32 +0100
commit3f9da416457c4265b8f1179516a32ad1a987ff7d (patch)
treea9a66492e8ae1b0964046190e7253a06aaa65138 /src/libsystemd
parent63405595065fb60811440680b148261e9ec50704 (diff)
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.
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-bus/bus-kernel.c4
-rw-r--r--src/libsystemd/sd-bus/bus-kernel.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c
index 445bd7f3d1..64a74d6edd 100644
--- a/src/libsystemd/sd-bus/bus-kernel.c
+++ b/src/libsystemd/sd-bus/bus-kernel.c
@@ -1378,7 +1378,7 @@ static void bus_kernel_translate_policy(const BusNamePolicy *policy, struct kdbu
}
}
-int bus_kernel_create_starter(const char *bus, const char *name, BusNamePolicy *policy) {
+int bus_kernel_create_starter(const char *bus, const char *name, bool accept_fd, BusNamePolicy *policy) {
struct kdbus_cmd_hello *hello;
struct kdbus_item *n;
size_t policy_cnt = 0;
@@ -1420,7 +1420,7 @@ int bus_kernel_create_starter(const char *bus, const char *name, BusNamePolicy *
}
hello->size = size;
- hello->conn_flags = KDBUS_HELLO_ACTIVATOR|KDBUS_HELLO_ACCEPT_FD;
+ hello->conn_flags = KDBUS_HELLO_ACTIVATOR | (accept_fd ? KDBUS_HELLO_ACCEPT_FD : 0);
hello->pool_size = KDBUS_POOL_SIZE;
if (ioctl(fd, KDBUS_CMD_HELLO, hello) < 0) {
diff --git a/src/libsystemd/sd-bus/bus-kernel.h b/src/libsystemd/sd-bus/bus-kernel.h
index a1e9691f1d..3a9794fbe3 100644
--- a/src/libsystemd/sd-bus/bus-kernel.h
+++ b/src/libsystemd/sd-bus/bus-kernel.h
@@ -67,7 +67,7 @@ int bus_kernel_read_message(sd_bus *bus, bool hint_priority, int64_t priority);
int bus_kernel_create_bus(const char *name, bool world, char **s);
int bus_kernel_create_domain(const char *name, char **s);
-int bus_kernel_create_starter(const char *bus, const char *name, BusNamePolicy *policy);
+int bus_kernel_create_starter(const char *bus, const char *name, bool accept_fd, BusNamePolicy *policy);
int bus_kernel_create_monitor(const char *bus);
int bus_kernel_pop_memfd(sd_bus *bus, void **address, size_t *mapped, size_t *allocated);