diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-12-12 19:58:46 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-12-12 20:00:45 +0100 |
commit | 0f437184b687af58c5c4b2e3201a83d98485b0e4 (patch) | |
tree | 308a6b393307a15dc6b73b64d84658c39c9d4c7f /src/libsystemd-bus/sd-bus.c | |
parent | 9ff09bcb86fb125768667aca9bc0b10b1745370a (diff) |
bus: enforce endianess and marshalling for messages we send
Diffstat (limited to 'src/libsystemd-bus/sd-bus.c')
-rw-r--r-- | src/libsystemd-bus/sd-bus.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c index 37408cf7b4..1a60356311 100644 --- a/src/libsystemd-bus/sd-bus.c +++ b/src/libsystemd-bus/sd-bus.c @@ -1280,7 +1280,12 @@ static int bus_seal_message(sd_bus *b, sd_bus_message *m) { assert(b); assert(m); - if (m->header->version > b->message_version) + if (b->message_version != 0 && + m->header->version != b->message_version) + return -EPERM; + + if (b->message_endian != 0 && + m->header->endian != b->message_endian) return -EPERM; if (m->sealed) { @@ -1298,9 +1303,6 @@ int bus_seal_synthetic_message(sd_bus *b, sd_bus_message *m) { assert(b); assert(m); - if (m->header->version > b->message_version) - return -EPERM; - /* The bus specification says the serial number cannot be 0, * hence let's fill something in for synthetic messages. Since * synthetic messages might have a fake sender and we don't |