summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/busname.c13
-rw-r--r--src/core/busname.h2
-rw-r--r--src/core/load-fragment-gperf.gperf.m41
3 files changed, 12 insertions, 4 deletions
diff --git a/src/core/busname.c b/src/core/busname.c
index 9d7a796538..ccef32e9e7 100644
--- a/src/core/busname.c
+++ b/src/core/busname.c
@@ -43,6 +43,7 @@ static void busname_init(Unit *u) {
assert(u->load_state == UNIT_STUB);
n->starter_fd = -1;
+ n->accept_fd = true;
}
static void busname_done(Unit *u) {
@@ -170,10 +171,12 @@ static void busname_dump(Unit *u, FILE *f, const char *prefix) {
fprintf(f,
"%sBus Name State: %s\n"
"%sResult: %s\n"
- "%sName: %s\n",
+ "%sName: %s\n"
+ "%sAccept FD: %s\n",
prefix, busname_state_to_string(n->state),
prefix, busname_result_to_string(n->result),
- prefix, n->name);
+ prefix, n->name,
+ prefix, yes_no(n->accept_fd));
}
static void busname_unwatch_fd(BusName *n) {
@@ -226,8 +229,10 @@ static int busname_open_fd(BusName *n) {
if (n->starter_fd >= 0)
return 0;
- n->starter_fd = bus_kernel_create_starter(UNIT(n)->manager->running_as == SYSTEMD_SYSTEM ? "system" : "user",
- n->name, n->policy);
+ n->starter_fd = bus_kernel_create_starter(
+ UNIT(n)->manager->running_as == SYSTEMD_SYSTEM ? "system" : "user",
+ n->name, n->accept_fd, n->policy);
+
if (n->starter_fd < 0) {
log_warning_unit(UNIT(n)->id, "Failed to create starter fd: %s", strerror(-n->starter_fd));
return n->starter_fd;
diff --git a/src/core/busname.h b/src/core/busname.h
index f79f510ea2..7f591974de 100644
--- a/src/core/busname.h
+++ b/src/core/busname.h
@@ -56,6 +56,8 @@ struct BusName {
sd_event_source *event_source;
+ bool accept_fd;
+
LIST_HEAD(BusNamePolicy, policy);
};
diff --git a/src/core/load-fragment-gperf.gperf.m4 b/src/core/load-fragment-gperf.gperf.m4
index f85d868043..c793a1e25f 100644
--- a/src/core/load-fragment-gperf.gperf.m4
+++ b/src/core/load-fragment-gperf.gperf.m4
@@ -256,6 +256,7 @@ BusName.AllowUser, config_parse_bus_policy, 0,
BusName.AllowGroup, config_parse_bus_policy, 0, 0
BusName.AllowWorld, config_parse_bus_policy, 0, 0
BusName.SELinuxContext, config_parse_exec_selinux_context, 0, 0
+BusName.AcceptFileDescriptors, config_parse_bool, 0, offsetof(BusName, accept_fd)
m4_dnl
Mount.What, config_parse_string, 0, offsetof(Mount, parameters_fragment.what)
Mount.Where, config_parse_path, 0, offsetof(Mount, where)