[systemd-commits] src/bus-proxyd

Daniel Mack zonque at kemper.freedesktop.org
Tue Dec 23 09:42:12 PST 2014


 src/bus-proxyd/bus-proxyd.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit 3e0a2048978fcc7aff00797bdb876b2592c2fbc7
Author: Daniel Mack <daniel at zonque.org>
Date:   Tue Dec 23 18:36:29 2014 +0100

    bus-proxyd: ignore errors from sd_bus_creds_get_well_known_names()
    
    sd_bus_creds_get_well_known_names() fails with -ENODATA in case the
    message has no names attached, which is intended behavior if the
    remote connection didn't own any names at the time of sending.
    
    The function already deals with 'sender_names' being an empty strv,
    so we can just continue in such cases.

diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c
index d15bd83..6da7fb9 100644
--- a/src/bus-proxyd/bus-proxyd.c
+++ b/src/bus-proxyd/bus-proxyd.c
@@ -988,9 +988,7 @@ static int process_policy(sd_bus *from, sd_bus *to, sd_bus_message *m, Policy *p
                         return 0;
 
                 /* The message came from the kernel, and is sent to our legacy client. */
-                r = sd_bus_creds_get_well_known_names(&m->creds, &sender_names);
-                if (r < 0)
-                        return r;
+                sd_bus_creds_get_well_known_names(&m->creds, &sender_names);
 
                 (void) sd_bus_creds_get_uid(&m->creds, &sender_uid);
                 (void) sd_bus_creds_get_gid(&m->creds, &sender_gid);
@@ -1054,14 +1052,12 @@ static int process_policy(sd_bus *from, sd_bus *to, sd_bus_message *m, Policy *p
                         if (r < 0)
                                 return handle_policy_error(m, r);
 
-                        r = sd_bus_creds_get_well_known_names(destination_creds, &destination_names);
-                        if (r < 0)
-                                return handle_policy_error(m, r);
-
                         r = sd_bus_creds_get_unique_name(destination_creds, &destination_unique);
                         if (r < 0)
                                 return handle_policy_error(m, r);
 
+                        sd_bus_creds_get_well_known_names(destination_creds, &destination_names);
+
                         (void) sd_bus_creds_get_uid(destination_creds, &destination_uid);
                         (void) sd_bus_creds_get_gid(destination_creds, &destination_gid);
                 }



More information about the systemd-commits mailing list