chiark / gitweb /
sd-bus: add sd_bus_message.verify_destination_id and .destination_ptr
authorDaniel Mack <daniel@zonque.org>
Wed, 22 Oct 2014 12:41:53 +0000 (14:41 +0200)
committerDaniel Mack <daniel@zonque.org>
Tue, 11 Nov 2014 13:14:01 +0000 (14:14 +0100)
commit022fb8558e797483709ab3e9fe846f04f7026dac
tree506558821d73d5a71578d3bd66377be289f16d52
parent7e27f3121e5a10629302b5221eb21345f832724a
sd-bus: add sd_bus_message.verify_destination_id and .destination_ptr

kdbus learned to accept both a numerical destination ID as well as a
well-known-name. In that case, kdbus makes sure that the numerical ID is in
fact the owner of the provided name and fails otherwise.

This allows for race-free assertion of a bus name owner while sending a
message, which is a requirement for bus-proxyd.

Add two new fields to sd_bus_message, and set the numerical ID to
verify_destination_id if bus_message_setup_kmsg() is called for a
message with a well-known name.

Also, set the destination's name in the kdbus item to .destination_ptr
if it is non-NULL.

Normal users should not touch these fields, and they're not publicy
accessible.
src/libsystemd/sd-bus/bus-kernel.c
src/libsystemd/sd-bus/bus-message.c
src/libsystemd/sd-bus/bus-message.h