[systemd-commits] 2 commits - TODO src/bus-proxyd

Lennart Poettering lennart at kemper.freedesktop.org
Thu May 21 12:31:43 PDT 2015


 TODO                    |    4 ----
 src/bus-proxyd/driver.c |   11 ++++++++++-
 2 files changed, 10 insertions(+), 5 deletions(-)

New commits:
commit ebc9d211317bd3916282e8591e4a0bdcc5191183
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu May 21 21:31:23 2015 +0200

    update TODO

diff --git a/TODO b/TODO
index 6d42161..43b6968 100644
--- a/TODO
+++ b/TODO
@@ -24,10 +24,6 @@ External:
 * When lz4 gets an API for lz4 command output, make use of it to
   compress coredumps in a way compatible with /usr/bin/lz4.
 
-Before 220:
-
-* bus-proxy: GetConnectionSELinuxSecurityContext() is completely broken
-
 Features:
 
 * introduce an NSS module that uses machined info to give container UIDs pretty names when user namespacing is used.

commit b860a90ea5afd2da57225195c1cb7edd64a8b73d
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu May 21 21:24:55 2015 +0200

    bus-proxy: fix GetConnectionSELinuxSecurityContext() return value

diff --git a/src/bus-proxyd/driver.c b/src/bus-proxyd/driver.c
index 90ddd73..4ac955d 100644
--- a/src/bus-proxyd/driver.c
+++ b/src/bus-proxyd/driver.c
@@ -280,6 +280,7 @@ int bus_proxy_process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, SharedPoli
                 return synthetic_driver_send(m->bus, reply);
 
         } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "GetConnectionSELinuxSecurityContext")) {
+                _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
                 _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;
                 _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
 
@@ -293,7 +294,15 @@ int bus_proxy_process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, SharedPoli
                 if (!(creds->mask & SD_BUS_CREDS_SELINUX_CONTEXT))
                         return synthetic_reply_method_errno(m, -EOPNOTSUPP, NULL);
 
-                return synthetic_reply_method_return(m, "y", creds->label, strlen(creds->label));
+                r = sd_bus_message_new_method_return(m, &reply);
+                if (r < 0)
+                        return synthetic_reply_method_errno(m, r, NULL);
+
+                r = sd_bus_message_append_array(reply, 'y', creds->label, strlen(creds->label));
+                if (r < 0)
+                        return synthetic_reply_method_errno(m, r, NULL);
+
+                return synthetic_driver_send(m->bus, reply);
 
         } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "GetConnectionUnixProcessID")) {
                 _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;



More information about the systemd-commits mailing list