From c0765ddb74f20046c406a3ac99f34719d767f151 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 17 Feb 2015 20:30:33 +0100 Subject: sd-bus: allow setting a per-connection default value for the "allow-interactive-authentication" message flag Most of our client tools want to set this bit for all their method calls, even though it defaults to off in sd-bus, and rightfully so. Hence, to simplify thing, introduce a per sd_bus-object flag that sets the default value for all messages created on the connection. --- src/libsystemd/sd-bus/bus-message.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libsystemd/sd-bus/bus-message.c') diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c index 2959303033..076b85f3b9 100644 --- a/src/libsystemd/sd-bus/bus-message.c +++ b/src/libsystemd/sd-bus/bus-message.c @@ -634,6 +634,9 @@ static sd_bus_message *message_new(sd_bus *bus, uint8_t type) { m->root_container.need_offsets = BUS_MESSAGE_IS_GVARIANT(m); m->bus = sd_bus_ref(bus); + if (bus->allow_interactive_authorization) + m->header->flags |= BUS_MESSAGE_ALLOW_INTERACTIVE_AUTHORIZATION; + return m; } -- cgit v1.2.3-54-g00ecf