1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 19:21:53 +03:00

bus: seal off memfds when sealing messages

This commit is contained in:
Lennart Poettering 2013-05-15 00:46:24 +02:00
parent 9b05bc4866
commit 47e6ce32bb

View File

@ -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;