chiark / gitweb /
kdbus: downgrade warning if we cannot patch kdbus attach mask to DEBUG if kdbus is...
[elogind.git] / src / libsystemd / sd-bus / bus-kernel.c
index 98fd4fd3ec60a72841ab70c17fa3bac948eb1524..752c63adb3a1a636726d71ada3bcf9ad2256401a 100644 (file)
@@ -553,22 +553,17 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) {
 
                 case KDBUS_ITEM_PIDS:
 
-                        /* The PID starttime/TID might be missing,
-                         * when the data is faked by some data bus
-                         * proxy and it lacks that information about
-                         * the real client since SO_PEERCRED is used
-                         * for that. */
+                        /* The PID/TID might be missing, when the data
+                         * is faked by some data bus proxy and it
+                         * lacks that information about the real
+                         * client since SO_PEERCRED is used for
+                         * that. */
 
                         if (d->pids.pid > 0) {
                                 m->creds.pid = (pid_t) d->pids.pid;
                                 m->creds.mask |= SD_BUS_CREDS_PID & bus->creds_mask;
                         }
 
-                        if (d->pids.starttime > 0) {
-                                m->creds.pid_starttime = d->pids.starttime / NSEC_PER_USEC;
-                                m->creds.mask |= SD_BUS_CREDS_PID_STARTTIME & bus->creds_mask;
-                        }
-
                         if (d->pids.tid > 0) {
                                 m->creds.tid = (pid_t) d->pids.tid;
                                 m->creds.mask |= SD_BUS_CREDS_TID & bus->creds_mask;
@@ -1421,7 +1416,7 @@ uint64_t attach_flags_to_kdbus(uint64_t mask) {
                     SD_BUS_CREDS_GID|SD_BUS_CREDS_EGID|SD_BUS_CREDS_SGID|SD_BUS_CREDS_FSGID))
                 m |= KDBUS_ATTACH_CREDS;
 
-        if (mask & (SD_BUS_CREDS_PID|SD_BUS_CREDS_PID_STARTTIME|SD_BUS_CREDS_TID))
+        if (mask & (SD_BUS_CREDS_PID|SD_BUS_CREDS_TID))
                 m |= KDBUS_ATTACH_PIDS;
 
         if (mask & SD_BUS_CREDS_COMM)
@@ -1869,7 +1864,7 @@ int bus_kernel_fix_attach_mask(void) {
         r = write_string_file("/sys/module/kdbus/parameters/attach_flags_mask", buf);
         if (r < 0)
                 return log_full_errno(
-                                r == -EROFS ? LOG_DEBUG : LOG_WARNING, r,
+                                IN_SET(r, -ENOENT, -EROFS) ? LOG_DEBUG : LOG_WARNING, r,
                                 "Failed to write kdbus attach mask: %m");
 
         return 0;