summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-05-15 00:46:24 +0200
committerLennart Poettering <lennart@poettering.net>2013-05-15 00:46:24 +0200
commit47e6ce32bb5bc8353c2070b8247be82410f4d78e (patch)
tree3a4d42662b1a0d9109ae06ddebcb31124126bf21 /src/libsystemd-bus
parent9b05bc48662051314b47b18a3ef8b43b193f2367 (diff)
bus: seal off memfds when sealing messages
Diffstat (limited to 'src/libsystemd-bus')
-rw-r--r--src/libsystemd-bus/bus-message.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index e0fb1f41db..5783140cf8 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -3555,8 +3555,10 @@ int bus_message_parse_fields(sd_bus_message *m) {
}
int bus_message_seal(sd_bus_message *m, uint64_t serial) {
- int r;
+ struct bus_body_part *part;
size_t l, a;
+ unsigned i;
+ int r;
assert(m);
@@ -3595,6 +3597,10 @@ int bus_message_seal(sd_bus_message *m, uint64_t serial) {
m->header->fields_size -= a;
}
+ for (i = 0, part = &m->body; i < m->n_body_parts; i++, part = part->next)
+ if (part->memfd >= 0 && part->sealed)
+ ioctl(part->memfd, KDBUS_CMD_MEMFD_SEAL_SET, 1);
+
m->header->serial = serial;
m->sealed = true;