chiark / gitweb /
bus-proxy: be more verbose if messages cannot be forwarded
authorDavid Herrmann <dh.herrmann@gmail.com>
Sat, 14 Feb 2015 18:01:21 +0000 (19:01 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Sat, 14 Feb 2015 18:01:21 +0000 (19:01 +0100)
If we cannot forward messages, include information on the peer and message
just like the xml-policy does. This helps debugging such situations and
figuring out what exactly is going wrong.

src/bus-proxyd/proxy.c

index 4be2a6289aca7a738c93135b37ba30132dc3aad0..3dea908f5bd44cef79d2c81e2c0fa5c565e0b8ec 100644 (file)
@@ -729,7 +729,10 @@ static int proxy_process_destination_to_local(Proxy *p) {
 
                 /* Return the error to the client, if we can */
                 synthetic_reply_method_errnof(m, r, "Failed to forward message we got from destination: %m");
 
                 /* Return the error to the client, if we can */
                 synthetic_reply_method_errnof(m, r, "Failed to forward message we got from destination: %m");
-                log_error_errno(r, "Failed to send message to client, ignoring: %m");
+                log_error_errno(r,
+                         "Failed to forward message we got from destination: uid=" UID_FMT " gid=" GID_FMT" message=%s destination=%s path=%s interface=%s member=%s: %m",
+                         p->local_creds.uid, p->local_creds.gid, bus_message_type_to_string(m->header->type),
+                         strna(m->destination), strna(m->path), strna(m->interface), strna(m->member));
                 return 1;
         }
 
                 return 1;
         }
 
@@ -799,7 +802,10 @@ static int proxy_process_local_to_destination(Proxy *p) {
                                 return 1;
 
                         synthetic_reply_method_errnof(m, r, "Failed to forward message we got from local: %m");
                                 return 1;
 
                         synthetic_reply_method_errnof(m, r, "Failed to forward message we got from local: %m");
-                        log_error_errno(r, "Failed to send message to bus: %m");
+                        log_error_errno(r,
+                                 "Failed to forward message we got from local: uid=" UID_FMT " gid=" GID_FMT" message=%s destination=%s path=%s interface=%s member=%s: %m",
+                                 p->local_creds.uid, p->local_creds.gid, bus_message_type_to_string(m->header->type),
+                                 strna(m->destination), strna(m->path), strna(m->interface), strna(m->member));
                         return 1;
                 }
 
                         return 1;
                 }