Commit 1b9abbf0 authored by Kay Sievers's avatar Kay Sievers

bus: create kdbus bus without an active policy

parent f08838da
...@@ -408,7 +408,7 @@ int bus_kernel_create(const char *name, char **s) { ...@@ -408,7 +408,7 @@ int bus_kernel_create(const char *name, char **s) {
fname = alloca(offsetof(struct kdbus_cmd_fname, name) + DECIMAL_STR_MAX(uid_t) + 1 + l + 1); fname = alloca(offsetof(struct kdbus_cmd_fname, name) + DECIMAL_STR_MAX(uid_t) + 1 + l + 1);
sprintf(fname->name, "%lu-%s", (unsigned long) getuid(), name); sprintf(fname->name, "%lu-%s", (unsigned long) getuid(), name);
fname->size = offsetof(struct kdbus_cmd_fname, name) + strlen(fname->name) + 1; fname->size = offsetof(struct kdbus_cmd_fname, name) + strlen(fname->name) + 1;
fname->kernel_flags = KDBUS_CMD_FNAME_ACCESS_WORLD; fname->kernel_flags = KDBUS_CMD_FNAME_ACCESS_WORLD | KDBUS_CMD_FNAME_POLICY_NONE;
fname->user_flags = 0; fname->user_flags = 0;
p = strjoin("/dev/kdbus/", fname->name, "/bus", NULL); p = strjoin("/dev/kdbus/", fname->name, "/bus", NULL);
......
...@@ -201,6 +201,7 @@ enum { ...@@ -201,6 +201,7 @@ enum {
enum { enum {
KDBUS_CMD_FNAME_ACCESS_GROUP = 1, KDBUS_CMD_FNAME_ACCESS_GROUP = 1,
KDBUS_CMD_FNAME_ACCESS_WORLD = 2, KDBUS_CMD_FNAME_ACCESS_WORLD = 2,
KDBUS_CMD_FNAME_POLICY_NONE = 4,
}; };
struct kdbus_cmd_hello { struct kdbus_cmd_hello {
......
...@@ -92,7 +92,7 @@ int main(int argc, char *argv[]) { ...@@ -92,7 +92,7 @@ int main(int argc, char *argv[]) {
assert_se(r >= 0); assert_se(r >= 0);
r = sd_bus_release_name(a, "net.0pointer.foobar"); r = sd_bus_release_name(a, "net.0pointer.foobar");
assert_se(r < 0); assert_se(r >= 0);
sd_bus_unref(a); sd_bus_unref(a);
sd_bus_unref(b); sd_bus_unref(b);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment