|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From 5369c77d2ee864ac0464d4adc0774ee70ba9c4bc Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Daniel Mack <zonque@gmail.com>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Mon, 18 Aug 2014 22:07:47 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] bus: factor out bus policy items
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
In order to re-use the policy definitions, factor them out into their own
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
files.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Makefile.am | 2 ++
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/core/bus-common.c | 35 +++++++++++++++++++++++++++++++++++
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/core/bus-common.h | 35 +++++++++++++++++++++++++++++++++++
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/core/busname.c | 8 --------
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/core/busname.h | 16 +++-------------
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/core/load-fragment.c | 4 ++--
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/libsystemd/sd-bus/bus-kernel.c | 12 ++++++------
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/libsystemd/sd-bus/bus-kernel.h | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/test/test-tables.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
9 files changed, 85 insertions(+), 31 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
create mode 100644 src/core/bus-common.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
create mode 100644 src/core/bus-common.h
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/Makefile.am b/Makefile.am
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 9c946d7a92..68a78963c1 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/Makefile.am
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/Makefile.am
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -1026,6 +1026,8 @@ libsystemd_core_la_SOURCES = \
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/core/socket.h \
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/core/busname.c \
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/core/busname.h \
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ src/core/bus-common.c \
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ src/core/bus-common.h \
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/core/target.c \
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/core/target.h \
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/core/snapshot.c \
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/core/bus-common.c b/src/core/bus-common.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
new file mode 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 0000000000..4a61cb9a3a
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- /dev/null
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/core/bus-common.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -0,0 +1,35 @@
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+/***
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ This file is part of systemd.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ Copyright 2014 Daniel Mack
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ systemd is free software; you can redistribute it and/or modify it
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ under the terms of the GNU Lesser General Public License as published by
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ (at your option) any later version.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ systemd is distributed in the hope that it will be useful, but
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ Lesser General Public License for more details.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+***/
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+#include "special.h"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+#include "bus-kernel.h"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+#include "bus-internal.h"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+#include "bus-util.h"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+#include "service.h"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+#include "bus-common.h"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+static const char* const bus_policy_access_table[_BUS_POLICY_ACCESS_MAX] = {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ [BUS_POLICY_ACCESS_SEE] = "see",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ [BUS_POLICY_ACCESS_TALK] = "talk",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ [BUS_POLICY_ACCESS_OWN] = "own",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+};
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+DEFINE_STRING_TABLE_LOOKUP(bus_policy_access, BusPolicyAccess);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/core/bus-common.h b/src/core/bus-common.h
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
new file mode 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 0000000000..209f870c72
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- /dev/null
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/core/bus-common.h
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -0,0 +1,35 @@
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+#pragma once
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+#include "macro.h"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+/***
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ This file is part of systemd.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ Copyright 2014 Daniel Mack
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ systemd is free software; you can redistribute it and/or modify it
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ under the terms of the GNU Lesser General Public License as published by
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ (at your option) any later version.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ systemd is distributed in the hope that it will be useful, but
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ Lesser General Public License for more details.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+***/
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+typedef enum BusPolicyAccess {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ BUS_POLICY_ACCESS_SEE,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ BUS_POLICY_ACCESS_TALK,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ BUS_POLICY_ACCESS_OWN,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ _BUS_POLICY_ACCESS_MAX,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ _BUS_POLICY_ACCESS_INVALID = -1
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+} BusPolicyAccess;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+const char* bus_policy_access_to_string(BusPolicyAccess i) _const_;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+BusPolicyAccess bus_policy_access_from_string(const char *s) _pure_;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/core/busname.c b/src/core/busname.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 39ea6a0d93..22d2a6d24b 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/core/busname.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/core/busname.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -911,14 +911,6 @@ static const char* const busname_result_table[_BUSNAME_RESULT_MAX] = {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
DEFINE_STRING_TABLE_LOOKUP(busname_result, BusNameResult);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-static const char* const busname_policy_access_table[_BUSNAME_POLICY_ACCESS_MAX] = {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- [BUSNAME_POLICY_ACCESS_SEE] = "see",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- [BUSNAME_POLICY_ACCESS_TALK] = "talk",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- [BUSNAME_POLICY_ACCESS_OWN] = "own",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-};
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-DEFINE_STRING_TABLE_LOOKUP(busname_policy_access, BusNamePolicyAccess);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
const UnitVTable busname_vtable = {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
.object_size = sizeof(BusName),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/core/busname.h b/src/core/busname.h
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 65d57f710a..c9b653d82e 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/core/busname.h
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/core/busname.h
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -25,6 +25,7 @@ typedef struct BusName BusName;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
typedef struct BusNamePolicy BusNamePolicy;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
#include "unit.h"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+#include "bus-common.h"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
typedef enum BusNameState {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
BUSNAME_DEAD,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -58,17 +59,9 @@ typedef enum BusNamePolicyType {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
_BUSNAME_POLICY_TYPE_INVALID = -1
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
} BusNamePolicyType;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-typedef enum BusNamePolicyAccess {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- BUSNAME_POLICY_ACCESS_SEE,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- BUSNAME_POLICY_ACCESS_TALK,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- BUSNAME_POLICY_ACCESS_OWN,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- _BUSNAME_POLICY_ACCESS_MAX,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- _BUSNAME_POLICY_ACCESS_INVALID = -1
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-} BusNamePolicyAccess;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
struct BusNamePolicy {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
BusNamePolicyType type;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- BusNamePolicyAccess access;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ BusPolicyAccess access;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
char *name;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -97,7 +90,7 @@ struct BusName {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
pid_t control_pid;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
LIST_HEAD(BusNamePolicy, policy);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- BusNamePolicyAccess policy_world;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ BusPolicyAccess policy_world;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
};
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
extern const UnitVTable busname_vtable;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -107,6 +100,3 @@ BusNameState busname_state_from_string(const char *s) _pure_;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
const char* busname_result_to_string(BusNameResult i) _const_;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
BusNameResult busname_result_from_string(const char *s) _pure_;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-const char* busname_policy_access_to_string(BusNamePolicyAccess i) _const_;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-BusNamePolicyAccess busname_policy_access_from_string(const char *s) _pure_;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index fda27becb5..b4da6a550e 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/core/load-fragment.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/core/load-fragment.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -1686,7 +1686,7 @@ int config_parse_busname_service(
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return 0;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-DEFINE_CONFIG_PARSE_ENUM(config_parse_bus_policy_world, busname_policy_access, BusNamePolicyAccess, "Failed to parse bus name policy access");
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+DEFINE_CONFIG_PARSE_ENUM(config_parse_bus_policy_world, bus_policy_access, BusPolicyAccess, "Failed to parse bus name policy access");
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
int config_parse_bus_policy(
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
const char *unit,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -1736,7 +1736,7 @@ int config_parse_bus_policy(
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
access_str++;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
access_str += strspn(access_str, WHITESPACE);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- p->access = busname_policy_access_from_string(access_str);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ p->access = bus_policy_access_from_string(access_str);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (p->access < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
log_syntax(unit, LOG_ERR, filename, line, EINVAL,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
"Invalid busname policy access type '%s'", access_str);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 03c4165095..ca0eddb38d 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/libsystemd/sd-bus/bus-kernel.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/libsystemd/sd-bus/bus-kernel.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -1322,19 +1322,19 @@ int bus_kernel_create_bus(const char *name, bool world, char **s) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return fd;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-static int bus_kernel_translate_access(BusNamePolicyAccess access) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+static int bus_kernel_translate_access(BusPolicyAccess access) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
assert(access >= 0);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- assert(access < _BUSNAME_POLICY_ACCESS_MAX);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ assert(access < _BUS_POLICY_ACCESS_MAX);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
switch (access) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- case BUSNAME_POLICY_ACCESS_SEE:
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ case BUS_POLICY_ACCESS_SEE:
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return KDBUS_POLICY_SEE;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- case BUSNAME_POLICY_ACCESS_TALK:
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ case BUS_POLICY_ACCESS_TALK:
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return KDBUS_POLICY_TALK;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- case BUSNAME_POLICY_ACCESS_OWN:
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ case BUS_POLICY_ACCESS_OWN:
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return KDBUS_POLICY_OWN;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
default:
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -1414,7 +1414,7 @@ int bus_kernel_make_starter(
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
bool activating,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
bool accept_fd,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
BusNamePolicy *policy,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- BusNamePolicyAccess world_policy) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ BusPolicyAccess world_policy) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
struct kdbus_cmd_hello *hello;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
struct kdbus_item *n;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/libsystemd/sd-bus/bus-kernel.h b/src/libsystemd/sd-bus/bus-kernel.h
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 448dd3a797..182f953d47 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/libsystemd/sd-bus/bus-kernel.h
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/libsystemd/sd-bus/bus-kernel.h
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -66,7 +66,7 @@ int bus_kernel_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
int bus_kernel_read_message(sd_bus *bus, bool hint_priority, int64_t priority);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
int bus_kernel_open_bus_fd(const char *bus, char **path);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-int bus_kernel_make_starter(int fd, const char *name, bool activating, bool accept_fd, BusNamePolicy *policy, BusNamePolicyAccess world_policy);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+int bus_kernel_make_starter(int fd, const char *name, bool activating, bool accept_fd, BusNamePolicy *policy, BusPolicyAccess world_policy);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
int bus_kernel_create_bus(const char *name, bool world, char **s);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
int bus_kernel_create_domain(const char *name, char **s);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/test/test-tables.c b/src/test/test-tables.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 58fe4433b7..907958e461 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/test/test-tables.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/test/test-tables.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -55,7 +55,7 @@ int main(int argc, char **argv) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
test_table(architecture, ARCHITECTURE);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
test_table(automount_result, AUTOMOUNT_RESULT);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
test_table(automount_state, AUTOMOUNT_STATE);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- test_table(busname_policy_access, BUSNAME_POLICY_ACCESS);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ test_table(bus_policy_access, BUS_POLICY_ACCESS);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
test_table(busname_result, BUSNAME_RESULT);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
test_table(busname_state, BUSNAME_STATE);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
test_table(cgroup_device_policy, CGROUP_DEVICE_POLICY);
|