chiark / gitweb /
libsystemd-bus: copy over kdbus provided 128-bit bus id
[elogind.git] / src / libsystemd-bus / bus-kernel.c
index 08f1851b96ea9aeabcef78e55326e481a42d9410..d2fcfd7f928e38780053e31be826f408d002eeb0 100644 (file)
@@ -326,6 +326,7 @@ int bus_kernel_take_fd(sd_bus *b) {
         zero(hello);
         hello.size = sizeof(hello);
         hello.conn_flags = b->hello_flags;
+        hello.attach_flags = b->attach_flags;
         hello.pool_size = KDBUS_POOL_SIZE;
 
         r = ioctl(b->input_fd, KDBUS_CMD_HELLO, &hello);
@@ -356,6 +357,9 @@ int bus_kernel_take_fd(sd_bus *b) {
         b->bus_client = true;
         b->can_fds = !!(hello.conn_flags & KDBUS_HELLO_ACCEPT_FD);
 
+        /* the kernel told us the UUID of the underlying bus */
+        memcpy(b->server_id.bytes, hello.id128, sizeof(b->server_id.bytes));
+
         r = bus_start_running(b);
         if (r < 0)
                 return r;