summaryrefslogtreecommitdiff
path: root/src/bus-proxyd/bus-proxyd.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-10-20 21:50:37 +0200
committerLennart Poettering <lennart@poettering.net>2014-10-20 21:50:37 +0200
commit2dd1ca3fd696dfeffadf35ad6847af4df84f51e4 (patch)
tree3abf5d50781b7ba3be230c32ce22642620cfc6c4 /src/bus-proxyd/bus-proxyd.c
parent24078eebf3eb1fbda9a4a4478a85ea36c028f0ec (diff)
bus-proxy: let's make use of the translated errors get_creds_by_name() provides us with
Diffstat (limited to 'src/bus-proxyd/bus-proxyd.c')
-rw-r--r--src/bus-proxyd/bus-proxyd.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c
index 6ff0e8c154..d138a998ea 100644
--- a/src/bus-proxyd/bus-proxyd.c
+++ b/src/bus-proxyd/bus-proxyd.c
@@ -644,28 +644,31 @@ static int process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m) {
} else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "GetConnectionSELinuxSecurityContext")) {
_cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;
+ _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
- r = get_creds_by_message(a, m, SD_BUS_CREDS_SELINUX_CONTEXT, &creds, NULL);
+ r = get_creds_by_message(a, m, SD_BUS_CREDS_SELINUX_CONTEXT, &creds, &error);
if (r < 0)
- return synthetic_reply_method_errno(m, r, NULL);
+ return synthetic_reply_method_errno(m, r, &error);
return synthetic_reply_method_return(m, "y", creds->label, strlen(creds->label));
} else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "GetConnectionUnixProcessID")) {
_cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;
+ _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
- r = get_creds_by_message(a, m, SD_BUS_CREDS_PID, &creds, NULL);
+ r = get_creds_by_message(a, m, SD_BUS_CREDS_PID, &creds, &error);
if (r < 0)
- return synthetic_reply_method_errno(m, r, NULL);
+ return synthetic_reply_method_errno(m, r, &error);
return synthetic_reply_method_return(m, "u", (uint32_t) creds->pid);
} else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "GetConnectionUnixUser")) {
_cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;
+ _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
- r = get_creds_by_message(a, m, SD_BUS_CREDS_UID, &creds, NULL);
+ r = get_creds_by_message(a, m, SD_BUS_CREDS_UID, &creds, &error);
if (r < 0)
- return synthetic_reply_method_errno(m, r, NULL);
+ return synthetic_reply_method_errno(m, r, &error);
return synthetic_reply_method_return(m, "u", (uint32_t) creds->uid);