[systemd-commits] 3 commits - hwdb/70-mouse.hwdb src/bus-proxyd src/libsystemd
Lennart Poettering
lennart at kemper.freedesktop.org
Fri Jan 9 12:25:58 PST 2015
hwdb/70-mouse.hwdb | 2 ++
src/bus-proxyd/bus-proxyd.c | 18 ++++++++++++++++++
src/libsystemd/sd-bus/sd-bus.c | 10 +++++++---
3 files changed, 27 insertions(+), 3 deletions(-)
New commits:
commit 997eadb5534cbd3d1de3d93f6489a3b4d03405e1
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Jan 9 21:25:23 2015 +0100
sd-bus: even if we need a cookie when sending a message there's no need to needlessly send it if we don't actually need it
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index 15180d0..125b302 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -1704,8 +1704,8 @@ static int bus_send_internal(sd_bus *bus, sd_bus_message *_m, uint64_t *cookie,
/* If this is a reply and no reply was requested, then let's
* suppress this, if we can */
- if (m->dont_send && !cookie)
- return 1;
+ if (m->dont_send)
+ goto finish;
if ((bus->state == BUS_RUNNING || bus->state == BUS_HELLO) && bus->wqueue_size <= 0) {
size_t idx = 0;
@@ -1718,7 +1718,9 @@ static int bus_send_internal(sd_bus *bus, sd_bus_message *_m, uint64_t *cookie,
}
return r;
- } else if (!bus->is_kernel && idx < BUS_MESSAGE_SIZE(m)) {
+ }
+
+ if (!bus->is_kernel && idx < BUS_MESSAGE_SIZE(m)) {
/* Wasn't fully written. So let's remember how
* much was written. Note that the first entry
* of the wqueue array is always allocated so
@@ -1728,6 +1730,7 @@ static int bus_send_internal(sd_bus *bus, sd_bus_message *_m, uint64_t *cookie,
bus->wqueue_size = 1;
bus->windex = idx;
}
+
} else {
/* Just append it to the queue. */
@@ -1740,6 +1743,7 @@ static int bus_send_internal(sd_bus *bus, sd_bus_message *_m, uint64_t *cookie,
bus->wqueue[bus->wqueue_size ++] = sd_bus_message_ref(m);
}
+finish:
if (cookie)
*cookie = BUS_MESSAGE_COOKIE(m);
commit d714387ed7003ce011a3ed0f1a604a7984a8a68d
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Jan 9 21:24:37 2015 +0100
bus-proxy: make sure we have creds when two legacy clients talk to each other
diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c
index 6101a20..4d0a265 100644
--- a/src/bus-proxyd/bus-proxyd.c
+++ b/src/bus-proxyd/bus-proxyd.c
@@ -1008,6 +1008,24 @@ static int process_policy(sd_bus *from, sd_bus *to, sd_bus_message *m, Policy *p
(void) sd_bus_creds_get_uid(&m->creds, &sender_uid);
(void) sd_bus_creds_get_gid(&m->creds, &sender_gid);
+ if (sender_uid == UID_INVALID || sender_gid == GID_INVALID) {
+ _cleanup_bus_creds_unref_ sd_bus_creds *sender_creds = NULL;
+
+ /* If the message came from another legacy
+ * client, then the message creds will be
+ * missing, simply because on legacy clients
+ * per-message creds were unknown. In this
+ * case, query the creds of the peer
+ * instead. */
+
+ r = bus_get_name_creds_kdbus(from, m->sender, SD_BUS_CREDS_UID|SD_BUS_CREDS_GID, true, &sender_creds);
+ if (r < 0)
+ return handle_policy_error(m, r);
+
+ (void) sd_bus_creds_get_uid(sender_creds, &sender_uid);
+ (void) sd_bus_creds_get_gid(sender_creds, &sender_gid);
+ }
+
/* First check whether the sender can send the message to our name */
if (set_isempty(owned_names)) {
if (policy_check_send(policy, sender_uid, sender_gid, m->header->type, NULL, m->path, m->interface, m->member))
commit 4540817b0d16ccd22d81a4120d3bc67e360809bb
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Jan 9 20:28:32 2015 +0100
hwdb: add Kay's Laser Mouse to the dpi database
diff --git a/hwdb/70-mouse.hwdb b/hwdb/70-mouse.hwdb
index 4a4603c..a7e9eb2 100644
--- a/hwdb/70-mouse.hwdb
+++ b/hwdb/70-mouse.hwdb
@@ -205,6 +205,8 @@ mouse:usb:v046dpc531:name:Logitech USB Receiver:
# Logitech USB Laser Mouse M-UAS144 [LS1 Laser Mouse]
mouse:usb:v046dpc062:name:Logitech USB Laser Mouse:
+# Logitech USB Laser Mouse M-U0007
+mouse:usb:v046dpc069:name:Logitech USB Laser Mouse:
MOUSE_DPI=1200 at 125
# Logitech T620 (or, the soap)
More information about the systemd-commits
mailing list