summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-message.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-12-09 11:12:41 +0100
committerDavid Herrmann <dh.herrmann@gmail.com>2014-12-09 11:14:55 +0100
commit77adde638217112c9e080035197a76f4dc4af700 (patch)
tree743b8c5e02f65c4002ec3385047b9d639c08fdd3 /src/libsystemd/sd-bus/bus-message.c
parentfbf7dcb5886f4077ee0dea618447ab488ff148fc (diff)
bus: sync with kdbus-git (ABI break)
kdbus-git gained two new features: * memfd offsets: This allows to specify a 'start' offset in kdbus_memfd so you can send partial memfd hunks instead of always the full memfd * KDBUS_HELLO_UNPRIVILEGED: If passed during HELLO, the client will be treated as unprivileged.
Diffstat (limited to 'src/libsystemd/sd-bus/bus-message.c')
-rw-r--r--src/libsystemd/sd-bus/bus-message.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
index ec3a39d051..ad417c0f10 100644
--- a/src/libsystemd/sd-bus/bus-message.c
+++ b/src/libsystemd/sd-bus/bus-message.c
@@ -1126,7 +1126,7 @@ static int part_make_space(
psz = PAGE_ALIGN(sz > 0 ? sz : 1);
if (part->mapped <= 0)
- n = mmap(NULL, psz, PROT_READ|PROT_WRITE, MAP_SHARED, part->memfd, 0);
+ n = mmap(NULL, psz, PROT_READ|PROT_WRITE, MAP_SHARED, part->memfd, part->memfd_offset);
else
n = mremap(part->data, part->mapped, psz, MREMAP_MAYMOVE);
@@ -2620,6 +2620,7 @@ _public_ int sd_bus_message_append_array_memfd(sd_bus_message *m,
return -ENOMEM;
part->memfd = copy_fd;
+ part->memfd_offset = 0;
part->sealed = true;
part->size = size;
copy_fd = -1;
@@ -2695,6 +2696,7 @@ _public_ int sd_bus_message_append_string_memfd(sd_bus_message *m, int memfd) {
return -ENOMEM;
part->memfd = copy_fd;
+ part->memfd_offset = 0;
part->sealed = true;
part->size = size;
copy_fd = -1;
@@ -2878,7 +2880,7 @@ int bus_body_part_map(struct bus_body_part *part) {
psz = PAGE_ALIGN(part->size);
if (part->memfd >= 0)
- p = mmap(NULL, psz, PROT_READ, MAP_PRIVATE, part->memfd, 0);
+ p = mmap(NULL, psz, PROT_READ, MAP_PRIVATE, part->memfd, part->memfd_offset);
else if (part->is_zero)
p = mmap(NULL, psz, PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
else