diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-03-13 20:33:22 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-03-13 20:33:22 +0100 |
commit | 42c4ebcbd4cbd7b27667eb8081ee4dc46f9ece17 (patch) | |
tree | 7174ce9a588da96d6b7370a0c369f484c55ed939 /src/libsystemd/sd-bus/sd-bus.c | |
parent | 82923adfe5c4fa09cc91fd2a2e374c936cd4a186 (diff) |
sd-bus: don't look for a 64bit value when we only have 32bit value on reply cookie hash table access
This broke hashtable lookups for the message cookies on s390x, which is
a 64bit BE machine where accessing 32bit values as 64bit and vice versa
will explode.
Also, while we are at it, be a bit more careful when dealing with the
64bit cookies we expose and the 32bit serial numbers dbus uses in its
payload.
Problem identified by Fridrich Strba.
Diffstat (limited to 'src/libsystemd/sd-bus/sd-bus.c')
-rw-r--r-- | src/libsystemd/sd-bus/sd-bus.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index ca7c428a31..8e44e502f7 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c @@ -1486,15 +1486,15 @@ static int bus_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call return r; if (bus->is_kernel || *idx >= BUS_MESSAGE_SIZE(m)) - log_debug("Sent message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%lu reply_cookie=%lu error=%s", + log_debug("Sent message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%" PRIu64 " reply_cookie=%" PRIu64 " error=%s", bus_message_type_to_string(m->header->type), strna(sd_bus_message_get_sender(m)), strna(sd_bus_message_get_destination(m)), strna(sd_bus_message_get_path(m)), strna(sd_bus_message_get_interface(m)), strna(sd_bus_message_get_member(m)), - (unsigned long) BUS_MESSAGE_COOKIE(m), - (unsigned long) m->reply_cookie, + BUS_MESSAGE_COOKIE(m), + m->reply_cookie, strna(m->error.message)); return r; @@ -2253,15 +2253,15 @@ static int process_message(sd_bus *bus, sd_bus_message *m) { bus->current = m; bus->iteration_counter++; - log_debug("Got message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%lu reply_cookie=%lu error=%s", + log_debug("Got message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%" PRIu64 " reply_cookie=%" PRIu64 " error=%s", bus_message_type_to_string(m->header->type), strna(sd_bus_message_get_sender(m)), strna(sd_bus_message_get_destination(m)), strna(sd_bus_message_get_path(m)), strna(sd_bus_message_get_interface(m)), strna(sd_bus_message_get_member(m)), - (unsigned long) BUS_MESSAGE_COOKIE(m), - (unsigned long) m->reply_cookie, + BUS_MESSAGE_COOKIE(m), + m->reply_cookie, strna(m->error.message)); r = process_hello(bus, m); |