chiark / gitweb /
bus: sync with kdbus.git
[elogind.git] / src / libsystemd / sd-bus / bus-control.c
index 6a9e9b296ad2df56277b415b9845381e8e946688..e86546c34394711a8bdc64ff1d04534ff3dde7b7 100644 (file)
@@ -232,6 +232,7 @@ static int kernel_get_list(sd_bus *bus, uint64_t flags, char ***x) {
 
         /* Caller will free half-constructed list on failure... */
 
+        cmd.size = sizeof(cmd);
         cmd.flags = flags;
 
         r = ioctl(bus->input_fd, KDBUS_CMD_NAME_LIST, &cmd);
@@ -405,11 +406,6 @@ static int bus_populate_creds_from_items(
                                 c->mask |= SD_BUS_CREDS_TID;
                         }
 
-                        if (mask & SD_BUS_CREDS_PID_STARTTIME && item->pids.starttime > 0) {
-                                c->pid_starttime = item->pids.starttime;
-                                c->mask |= SD_BUS_CREDS_PID_STARTTIME;
-                        }
-
                         break;
 
                 case KDBUS_ITEM_CREDS:
@@ -751,8 +747,7 @@ static int bus_get_name_creds_dbus1(
 
                 if ((mask & SD_BUS_CREDS_PID) ||
                     ((mask & SD_BUS_CREDS_AUGMENT) &&
-                     (mask & (SD_BUS_CREDS_PID_STARTTIME|
-                              SD_BUS_CREDS_EUID|SD_BUS_CREDS_SUID|SD_BUS_CREDS_FSUID|
+                     (mask & (SD_BUS_CREDS_EUID|SD_BUS_CREDS_SUID|SD_BUS_CREDS_FSUID|
                               SD_BUS_CREDS_GID|SD_BUS_CREDS_EGID|SD_BUS_CREDS_SGID|SD_BUS_CREDS_FSGID|
                               SD_BUS_CREDS_COMM|SD_BUS_CREDS_EXE|SD_BUS_CREDS_CMDLINE|
                               SD_BUS_CREDS_CGROUP|SD_BUS_CREDS_UNIT|SD_BUS_CREDS_USER_UNIT|SD_BUS_CREDS_SLICE|SD_BUS_CREDS_SESSION|SD_BUS_CREDS_OWNER_UID|
@@ -1180,6 +1175,10 @@ int bus_add_match_internal_kernel(
 
         assert(bus);
 
+        /* Monitor streams don't support matches, make this a NOP */
+        if (bus->hello_flags & KDBUS_HELLO_MONITOR)
+                return 0;
+
         bloom = alloca0(bus->bloom_size);
 
         sz = ALIGN8(offsetof(struct kdbus_cmd_match, items));
@@ -1392,6 +1391,10 @@ int bus_remove_match_internal_kernel(
 
         assert(bus);
 
+        /* Monitor streams don't support matches, make this a NOP */
+        if (bus->hello_flags & KDBUS_HELLO_MONITOR)
+                return 0;
+
         zero(m);
         m.size = offsetof(struct kdbus_cmd_match, items);
         m.cookie = cookie;