chiark / gitweb /
bus-proxyd: optimize replies if they're not requested
[elogind.git] / src / bus-proxyd / bus-proxyd.c
index fc70cce9402392dea2795996cb81ae0d18202af9..44e16fcd15c6b87a536cd1a66aee62a981fe28a3 100644 (file)
@@ -189,7 +189,7 @@ static int rename_service(sd_bus *a, sd_bus *b) {
         assert(a);
         assert(b);
 
-        r = sd_bus_get_owner_creds(b, SD_BUS_CREDS_UID|SD_BUS_CREDS_PID|SD_BUS_CREDS_CMDLINE|SD_BUS_CREDS_COMM, &creds);
+        r = sd_bus_get_owner_creds(b, SD_BUS_CREDS_UID|SD_BUS_CREDS_PID|SD_BUS_CREDS_CMDLINE|SD_BUS_CREDS_COMM|SD_BUS_CREDS_AUGMENT, &creds);
         if (r < 0)
                 return r;
 
@@ -405,6 +405,9 @@ static int synthetic_reply_return_strv(sd_bus_message *call, char **l) {
 
         assert(call);
 
+        if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
+                return 0;
+
         r = sd_bus_message_new_method_return(call, &m);
         if (r < 0)
                 return synthetic_reply_method_errno(call, r, NULL);
@@ -829,10 +832,6 @@ static int process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, Policy *polic
                 if (r < 0)
                         return synthetic_reply_method_errno(m, r, NULL);
 
-                if (streq(name, "org.freedesktop.DBus"))
-                        return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS,
-                                                            "Connection is not allowed to own the org.freedesktop.DBus service."));
-
                 if (policy && !policy_check_own(policy, ucred->uid, ucred->gid, name))
                         return synthetic_reply_method_errno(m, -EPERM, NULL);