From 486e99a387adec15738c2822c2df5c813955f433 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sat, 1 Feb 2014 14:41:13 +0100 Subject: [PATCH] bus: update kdbus.h (ABI break) --- src/core/manager.c | 2 +- src/libsystemd/sd-bus/PORTING-DBUS1 | 2 +- src/libsystemd/sd-bus/bus-kernel.c | 6 +++--- src/libsystemd/sd-bus/bus-kernel.h | 2 +- src/libsystemd/sd-bus/kdbus.h | 22 +++++++++++----------- src/nspawn/nspawn.c | 12 ++++++------ 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/core/manager.c b/src/core/manager.c index b181aa045..3f8bf58be 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -599,7 +599,7 @@ static int manager_setup_kdbus(Manager *m) { * necessary to ensure that users cannot get access to busses * of virtualized users when no UID namespacing is used. */ if (m->running_as == SYSTEMD_SYSTEM) - mkdir_p_label("/dev/kdbus/ns", 0700); + mkdir_p_label("/dev/kdbus/domain", 0700); #endif return 0; diff --git a/src/libsystemd/sd-bus/PORTING-DBUS1 b/src/libsystemd/sd-bus/PORTING-DBUS1 index 492f55b4b..90d184b78 100644 --- a/src/libsystemd/sd-bus/PORTING-DBUS1 +++ b/src/libsystemd/sd-bus/PORTING-DBUS1 @@ -508,7 +508,7 @@ have attached. Note that when issuing the ioctl, you can select a different set of credentials to gather, than what was originally requested for being attached to incoming messages. -Credentials are always specific to the sender namespace that was +Credentials are always specific to the sender's domain that was current at the time of sending, and of the process that opened the bus connection at the time of opening it. Note that this latter data is cached! diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c index 26cd806b5..712ef00fc 100644 --- a/src/libsystemd/sd-bus/bus-kernel.c +++ b/src/libsystemd/sd-bus/bus-kernel.c @@ -1388,7 +1388,7 @@ int bus_kernel_create_starter(const char *bus, const char *name) { return fd; } -int bus_kernel_create_namespace(const char *name, char **s) { +int bus_kernel_create_domain(const char *name, char **s) { struct kdbus_cmd_make *make; struct kdbus_item *n; int fd; @@ -1412,7 +1412,7 @@ int bus_kernel_create_namespace(const char *name, char **s) { make->size = ALIGN8(offsetof(struct kdbus_cmd_make, items) + n->size); make->flags = KDBUS_MAKE_POLICY_OPEN | KDBUS_MAKE_ACCESS_WORLD; - if (ioctl(fd, KDBUS_CMD_NS_MAKE, make) < 0) { + if (ioctl(fd, KDBUS_CMD_DOMAIN_MAKE, make) < 0) { close_nointr_nofail(fd); return -errno; } @@ -1427,7 +1427,7 @@ int bus_kernel_create_namespace(const char *name, char **s) { if (s) { char *p; - p = strappend("/dev/kdbus/ns/", name); + p = strappend("/dev/kdbus/domain/", name); if (!p) { close_nointr_nofail(fd); return -ENOMEM; diff --git a/src/libsystemd/sd-bus/bus-kernel.h b/src/libsystemd/sd-bus/bus-kernel.h index de02b84f8..8db418a14 100644 --- a/src/libsystemd/sd-bus/bus-kernel.h +++ b/src/libsystemd/sd-bus/bus-kernel.h @@ -64,7 +64,7 @@ int bus_kernel_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call 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_namespace(const char *name, char **s); +int bus_kernel_create_domain(const char *name, char **s); int bus_kernel_create_starter(const char *bus, const char *name); int bus_kernel_create_monitor(const char *bus); diff --git a/src/libsystemd/sd-bus/kdbus.h b/src/libsystemd/sd-bus/kdbus.h index bdaf25e6e..c9a894015 100644 --- a/src/libsystemd/sd-bus/kdbus.h +++ b/src/libsystemd/sd-bus/kdbus.h @@ -105,7 +105,7 @@ struct kdbus_audit { /** * struct kdbus_timestamp - * @seqnum: Global per-namespace message sequence number + * @seqnum: Global per-domain message sequence number * @monotonic_ns: Monotonic timestamp, in nanoseconds * @realtime_ns: Realtime timestamp, in nanoseconds * @@ -233,7 +233,7 @@ struct kdbus_policy { * @KDBUS_ITEM_BLOOM_MASK: Bloom mask used to match against a message's * bloom filter * @KDBUS_ITEM_DST_NAME: Destination's well-known name - * @KDBUS_ITEM_MAKE_NAME: Name of namespace, bus, endpoint + * @KDBUS_ITEM_MAKE_NAME: Name of domain, bus, endpoint * @KDBUS_ITEM_MEMFD_NAME: The human readable name of a memfd (debugging) * @KDBUS_ITEM_ATTACH_FLAGS: Attach-flags, used for updating which metadata * a connection subscribes to @@ -592,13 +592,13 @@ enum kdbus_make_flags { }; /** - * struct kdbus_cmd_make - struct to make a bus, an endpoint or a namespace + * struct kdbus_cmd_make - struct to make a bus, an endpoint or a domain * @size: The total size of the struct - * @flags: Properties for the bus/ep/ns to create + * @flags: Properties for the bus/ep/domain to create * @items: Items describing details * * This structure is used with the KDBUS_CMD_BUS_MAKE, KDBUS_CMD_EP_MAKE and - * KDBUS_CMD_NS_MAKE ioctls. + * KDBUS_CMD_DOMAIN_MAKE ioctls. */ struct kdbus_cmd_make { __u64 size; @@ -781,8 +781,8 @@ struct kdbus_cmd_memfd_make { * name. The bus is immediately shut down and * cleaned up when the opened "control" device node * is closed. - * @KDBUS_CMD_NS_MAKE: Similar to KDBUS_CMD_BUS_MAKE, but it creates a - * new kdbus namespace. + * @KDBUS_CMD_DOMAIN_MAKE: Similar to KDBUS_CMD_BUS_MAKE, but it creates a + * new kdbus domain. * @KDBUS_CMD_EP_MAKE: Creates a new named special endpoint to talk to * the bus. Such endpoints usually carry a more * restrictive policy and grant restricted access @@ -853,7 +853,7 @@ struct kdbus_cmd_memfd_make { */ enum kdbus_ioctl_type { KDBUS_CMD_BUS_MAKE = _IOW (KDBUS_IOC_MAGIC, 0x00, struct kdbus_cmd_make), - KDBUS_CMD_NS_MAKE = _IOW (KDBUS_IOC_MAGIC, 0x10, struct kdbus_cmd_make), + KDBUS_CMD_DOMAIN_MAKE = _IOW (KDBUS_IOC_MAGIC, 0x10, struct kdbus_cmd_make), KDBUS_CMD_EP_MAKE = _IOW (KDBUS_IOC_MAGIC, 0x20, struct kdbus_cmd_make), KDBUS_CMD_HELLO = _IOWR(KDBUS_IOC_MAGIC, 0x30, struct kdbus_cmd_hello), @@ -897,7 +897,7 @@ enum kdbus_ioctl_type { * inconsistent types. * @EBUSY: The user tried to say BYEBYE to a connection, but the * connection had a non-empty message list. - * @ECANCELED: A syncronous message sending was cancelled. + * @ECANCELED: A synchronous message sending was cancelled. * @ECONNRESET: A connection is shut down, no further operations are * possible. * @ECOMM: A peer does not accept the file descriptors addressed @@ -905,7 +905,7 @@ enum kdbus_ioctl_type { * @EDESTADDRREQ: The well-known bus name is required but missing. * @EDOM: The size of data does not match the expectations. Used * for bloom bit field sizes. - * @EEXIST: A requested namespace, bus or endpoint with the same + * @EEXIST: A requested domain, bus or endpoint with the same * name already exists. A specific data type, which is * only expected once, is provided multiple times. * @EFAULT: The supplied memory could not be accessed, or the data @@ -947,7 +947,7 @@ enum kdbus_ioctl_type { * @EPIPE: When sending a message, a synchronous reply from the * receiving connection was expected but the connection * died before answering. - * @ESHUTDOWN: A namespace or endpoint is currently shutting down; + * @ESHUTDOWN: A domain or endpoint is currently shutting down; * no further operations will be possible. * @ESRCH: A requested well-known bus name is not found. * @ETIMEDOUT: A synchronous wait for a message reply did not arrive diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 5352b95ec..f0e7b0619 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -974,7 +974,7 @@ static int setup_kdbus(const char *dest, const char *path) { } if (mount(path, p, "bind", MS_BIND, NULL) < 0) { - log_error("Failed to mount kdbus namespace path: %m"); + log_error("Failed to mount kdbus domain path: %m"); return -errno; } @@ -1092,7 +1092,7 @@ int main(int argc, char *argv[]) { sigset_t mask; _cleanup_close_pipe_ int kmsg_socket_pair[2] = { -1, -1 }; _cleanup_fdset_free_ FDSet *fds = NULL; - _cleanup_free_ char *kdbus_namespace = NULL; + _cleanup_free_ char *kdbus_domain = NULL; const char *ns; log_parse_environment(); @@ -1195,11 +1195,11 @@ int main(int argc, char *argv[]) { } ns = strappenda("machine-", arg_machine); - kdbus_fd = bus_kernel_create_namespace(ns, &kdbus_namespace); + kdbus_fd = bus_kernel_create_domain(ns, &kdbus_domain); if (r < 0) - log_debug("Failed to create kdbus namespace: %s", strerror(-r)); + log_debug("Failed to create kdbus domain: %s", strerror(-r)); else - log_debug("Successfully created kdbus namespace as %s", kdbus_namespace); + log_debug("Successfully created kdbus domain as %s", kdbus_domain); if (socketpair(AF_UNIX, SOCK_DGRAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0, kmsg_socket_pair) < 0) { log_error("Failed to create kmsg socket pair: %m"); @@ -1356,7 +1356,7 @@ int main(int argc, char *argv[]) { if (mount_binds(arg_directory, arg_bind_ro, MS_RDONLY) < 0) goto child_fail; - if (setup_kdbus(arg_directory, kdbus_namespace) < 0) + if (setup_kdbus(arg_directory, kdbus_domain) < 0) goto child_fail; if (chdir(arg_directory) < 0) { -- 2.30.2