Upgrade to thud
[AGL/meta-agl.git] / meta-security / recipes-core / dbus-cynara / dbus-cynara / 0004-Add-own-rule-result-unavailability-handling.patch
1 From 5bf7f759a738a451ea70732731d9a1b3e064353b Mon Sep 17 00:00:00 2001
2 From: Jacek Bukarewicz <j.bukarewicz@samsung.com>
3 Date: Thu, 27 Nov 2014 11:26:21 +0100
4 Subject: [PATCH 4/5] Add own rule result unavailability handling
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Own rule result unavailability is handled like send rules - dispatching
10 messages from the sender is blocked and resumed when result becomes
11 available.
12
13 Handler of "RequestName" method needs to return BUS_RESULT_LATER when
14 policy result is not known therefore its return type is modified.
15 Since bus message handlers are put into function pointer array other
16 message handler function singatures are also affected.
17
18 Change-Id: I4c2cbd4585e41fccd8a30f825a8f0d342ab56755
19
20 Cherry-picked from 35ef89cd6777ea2430077fc621d21bd01df92349 by Jose.bollo
21
22 Updated for dbus 1.12.10 by Scott Murray.
23
24 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
25 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
26
27 diff --git a/bus/dispatch.c b/bus/dispatch.c
28 index 1bdcbf0..625add5 100644
29 --- a/bus/dispatch.c
30 +++ b/bus/dispatch.c
31 @@ -516,8 +516,17 @@ bus_dispatch (DBusConnection *connection,
32          }
33  
34        _dbus_verbose ("Giving message to %s\n", DBUS_SERVICE_DBUS);
35 -      if (!bus_driver_handle_message (connection, transaction, message, &error))
36 +      res = bus_driver_handle_message (connection, transaction, message, &error);
37 +      if (res == BUS_RESULT_FALSE)
38          goto out;
39 +      else if (res == BUS_RESULT_LATER)
40 +        {
41 +          /* connection has been disabled in message handler */
42 +          bus_transaction_cancel_and_free (transaction);
43 +          transaction = NULL;
44 +          result = DBUS_HANDLER_RESULT_LATER;
45 +          goto out;
46 +        }
47      }
48    else if (!bus_connection_is_active (connection)) /* clients must talk to bus driver first */
49      {
50 diff --git a/bus/driver.c b/bus/driver.c
51 index d89a658..5ee60cb 100644
52 --- a/bus/driver.c
53 +++ b/bus/driver.c
54 @@ -420,7 +420,7 @@ create_unique_client_name (BusRegistry *registry,
55    return TRUE;
56  }
57  
58 -static dbus_bool_t
59 +static BusResult
60  bus_driver_handle_hello (DBusConnection *connection,
61                           BusTransaction *transaction,
62                           DBusMessage    *message,
63 @@ -428,7 +428,7 @@ bus_driver_handle_hello (DBusConnection *connection,
64  {
65    DBusString unique_name;
66    BusService *service;
67 -  dbus_bool_t retval;
68 +  BusResult retval;
69    BusRegistry *registry;
70    BusConnections *connections;
71    DBusError tmp_error;
72 @@ -442,7 +442,7 @@ bus_driver_handle_hello (DBusConnection *connection,
73        /* We already handled an Hello message for this connection. */
74        dbus_set_error (error, DBUS_ERROR_FAILED,
75                        "Already handled an Hello message");
76 -      return FALSE;
77 +      return BUS_RESULT_FALSE;
78      }
79  
80    /* Note that when these limits are exceeded we don't disconnect the
81 @@ -464,16 +464,16 @@ bus_driver_handle_hello (DBusConnection *connection,
82        bus_context_log (context, DBUS_SYSTEM_LOG_WARNING, "%s (%s=%d)",
83            tmp_error.message, limit_name, limit);
84        dbus_move_error (&tmp_error, error);
85 -      return FALSE;
86 +      return BUS_RESULT_FALSE;
87      }
88  
89    if (!_dbus_string_init (&unique_name))
90      {
91        BUS_SET_OOM (error);
92 -      return FALSE;
93 +      return BUS_RESULT_FALSE;
94      }
95  
96 -  retval = FALSE;
97 +  retval = BUS_RESULT_FALSE;
98  
99    registry = bus_connection_get_registry (connection);
100  
101 @@ -506,7 +506,7 @@ bus_driver_handle_hello (DBusConnection *connection,
102      goto out_0;
103  
104    _dbus_assert (bus_connection_is_active (connection));
105 -  retval = TRUE;
106 +  retval = BUS_RESULT_TRUE;
107  
108   out_0:
109    _dbus_string_free (&unique_name);
110 @@ -558,7 +558,7 @@ bus_driver_send_welcome_message (DBusConnection *connection,
111      }
112  }
113  
114 -static dbus_bool_t
115 +static BusResult
116  bus_driver_handle_list_services (DBusConnection *connection,
117                                   BusTransaction *transaction,
118                                   DBusMessage    *message,
119 @@ -580,14 +580,14 @@ bus_driver_handle_list_services (DBusConnection *connection,
120    if (reply == NULL)
121      {
122        BUS_SET_OOM (error);
123 -      return FALSE;
124 +      return BUS_RESULT_FALSE;
125      }
126  
127    if (!bus_registry_list_services (registry, &services, &len))
128      {
129        dbus_message_unref (reply);
130        BUS_SET_OOM (error);
131 -      return FALSE;
132 +      return BUS_RESULT_FALSE;
133      }
134  
135    dbus_message_iter_init_append (reply, &iter);
136 @@ -599,7 +599,7 @@ bus_driver_handle_list_services (DBusConnection *connection,
137        dbus_free_string_array (services);
138        dbus_message_unref (reply);
139        BUS_SET_OOM (error);
140 -      return FALSE;
141 +      return BUS_RESULT_FALSE;
142      }
143  
144    {
145 @@ -611,7 +611,7 @@ bus_driver_handle_list_services (DBusConnection *connection,
146          dbus_free_string_array (services);
147          dbus_message_unref (reply);
148          BUS_SET_OOM (error);
149 -        return FALSE;
150 +        return BUS_RESULT_FALSE;
151        }
152    }
153  
154 @@ -624,7 +624,7 @@ bus_driver_handle_list_services (DBusConnection *connection,
155            dbus_free_string_array (services);
156            dbus_message_unref (reply);
157            BUS_SET_OOM (error);
158 -          return FALSE;
159 +          return BUS_RESULT_FALSE;
160          }
161        ++i;
162      }
163 @@ -635,23 +635,23 @@ bus_driver_handle_list_services (DBusConnection *connection,
164      {
165        dbus_message_unref (reply);
166        BUS_SET_OOM (error);
167 -      return FALSE;
168 +      return BUS_RESULT_FALSE;
169      }
170  
171    if (!bus_transaction_send_from_driver (transaction, connection, reply))
172      {
173        dbus_message_unref (reply);
174        BUS_SET_OOM (error);
175 -      return FALSE;
176 +      return BUS_RESULT_FALSE;
177      }
178    else
179      {
180        dbus_message_unref (reply);
181 -      return TRUE;
182 +      return BUS_RESULT_TRUE;
183      }
184  }
185  
186 -static dbus_bool_t
187 +static BusResult
188  bus_driver_handle_list_activatable_services (DBusConnection *connection,
189                                              BusTransaction *transaction,
190                                              DBusMessage    *message,
191 @@ -673,14 +673,14 @@ bus_driver_handle_list_activatable_services (DBusConnection *connection,
192    if (reply == NULL)
193      {
194        BUS_SET_OOM (error);
195 -      return FALSE;
196 +      return BUS_RESULT_FALSE;
197      }
198  
199    if (!bus_activation_list_services (activation, &services, &len))
200      {
201        dbus_message_unref (reply);
202        BUS_SET_OOM (error);
203 -      return FALSE;
204 +      return BUS_RESULT_FALSE;
205      }
206  
207    dbus_message_iter_init_append (reply, &iter);
208 @@ -692,7 +692,7 @@ bus_driver_handle_list_activatable_services (DBusConnection *connection,
209        dbus_free_string_array (services);
210        dbus_message_unref (reply);
211        BUS_SET_OOM (error);
212 -      return FALSE;
213 +      return BUS_RESULT_FALSE;
214      }
215  
216    {
217 @@ -704,7 +704,7 @@ bus_driver_handle_list_activatable_services (DBusConnection *connection,
218         dbus_free_string_array (services);
219         dbus_message_unref (reply);
220         BUS_SET_OOM (error);
221 -       return FALSE;
222 +       return BUS_RESULT_FALSE;
223        }
224    }
225  
226 @@ -717,7 +717,7 @@ bus_driver_handle_list_activatable_services (DBusConnection *connection,
227           dbus_free_string_array (services);
228           dbus_message_unref (reply);
229           BUS_SET_OOM (error);
230 -         return FALSE;
231 +         return BUS_RESULT_FALSE;
232         }
233        ++i;
234      }
235 @@ -728,23 +728,23 @@ bus_driver_handle_list_activatable_services (DBusConnection *connection,
236      {
237        dbus_message_unref (reply);
238        BUS_SET_OOM (error);
239 -      return FALSE;
240 +      return BUS_RESULT_FALSE;
241      }
242  
243    if (!bus_transaction_send_from_driver (transaction, connection, reply))
244      {
245        dbus_message_unref (reply);
246        BUS_SET_OOM (error);
247 -      return FALSE;
248 +      return BUS_RESULT_FALSE;
249      }
250    else
251      {
252        dbus_message_unref (reply);
253 -      return TRUE;
254 +      return BUS_RESULT_TRUE;
255      }
256  }
257  
258 -static dbus_bool_t
259 +static BusResult
260  bus_driver_handle_acquire_service (DBusConnection *connection,
261                                     BusTransaction *transaction,
262                                     DBusMessage    *message,
263 @@ -755,7 +755,8 @@ bus_driver_handle_acquire_service (DBusConnection *connection,
264    const char *name;
265    dbus_uint32_t service_reply;
266    dbus_uint32_t flags;
267 -  dbus_bool_t retval;
268 +  BusResult retval;
269 +  BusResult res;
270    BusRegistry *registry;
271  
272    _DBUS_ASSERT_ERROR_IS_CLEAR (error);
273 @@ -766,20 +767,24 @@ bus_driver_handle_acquire_service (DBusConnection *connection,
274                                DBUS_TYPE_STRING, &name,
275                                DBUS_TYPE_UINT32, &flags,
276                                DBUS_TYPE_INVALID))
277 -    return FALSE;
278 +    return BUS_RESULT_FALSE;
279  
280    _dbus_verbose ("Trying to own name %s with flags 0x%x\n", name, flags);
281  
282 -  retval = FALSE;
283 +  retval = BUS_RESULT_FALSE;
284    reply = NULL;
285  
286    _dbus_string_init_const (&service_name, name);
287  
288 -  if (!bus_registry_acquire_service (registry, connection,
289 -                                     &service_name, flags,
290 -                                     &service_reply, transaction,
291 -                                     error))
292 -    goto out;
293 +  res = bus_registry_acquire_service (registry, connection, message,
294 +                                       &service_name, flags,
295 +                                       &service_reply, transaction,
296 +                                       error);
297 +  if (res != BUS_RESULT_TRUE)
298 +    {
299 +      retval = res;
300 +      goto out;
301 +    }
302  
303    reply = dbus_message_new_method_return (message);
304    if (reply == NULL)
305 @@ -800,7 +805,7 @@ bus_driver_handle_acquire_service (DBusConnection *connection,
306        goto out;
307      }
308  
309 -  retval = TRUE;
310 +  retval = BUS_RESULT_TRUE;
311  
312   out:
313    if (reply)
314 @@ -808,7 +813,7 @@ bus_driver_handle_acquire_service (DBusConnection *connection,
315    return retval;
316  }
317  
318 -static dbus_bool_t
319 +static BusResult
320  bus_driver_handle_release_service (DBusConnection *connection,
321                                     BusTransaction *transaction,
322                                     DBusMessage    *message,
323 @@ -818,7 +823,7 @@ bus_driver_handle_release_service (DBusConnection *connection,
324    DBusString service_name;
325    const char *name;
326    dbus_uint32_t service_reply;
327 -  dbus_bool_t retval;
328 +  BusResult retval;
329    BusRegistry *registry;
330  
331    _DBUS_ASSERT_ERROR_IS_CLEAR (error);
332 @@ -828,11 +833,11 @@ bus_driver_handle_release_service (DBusConnection *connection,
333    if (!dbus_message_get_args (message, error,
334                                DBUS_TYPE_STRING, &name,
335                                DBUS_TYPE_INVALID))
336 -    return FALSE;
337 +    return BUS_RESULT_FALSE;
338  
339    _dbus_verbose ("Trying to release name %s\n", name);
340  
341 -  retval = FALSE;
342 +  retval = BUS_RESULT_FALSE;
343    reply = NULL;
344  
345    _dbus_string_init_const (&service_name, name);
346 @@ -861,7 +866,7 @@ bus_driver_handle_release_service (DBusConnection *connection,
347        goto out;
348      }
349  
350 -  retval = TRUE;
351 +  retval = BUS_RESULT_TRUE;
352  
353   out:
354    if (reply)
355 @@ -869,7 +874,7 @@ bus_driver_handle_release_service (DBusConnection *connection,
356    return retval;
357  }
358  
359 -static dbus_bool_t
360 +static BusResult
361  bus_driver_handle_service_exists (DBusConnection *connection,
362                                    BusTransaction *transaction,
363                                    DBusMessage    *message,
364 @@ -880,7 +885,7 @@ bus_driver_handle_service_exists (DBusConnection *connection,
365    BusService *service;
366    dbus_bool_t service_exists;
367    const char *name;
368 -  dbus_bool_t retval;
369 +  BusResult retval;
370    BusRegistry *registry;
371  
372    _DBUS_ASSERT_ERROR_IS_CLEAR (error);
373 @@ -890,9 +895,9 @@ bus_driver_handle_service_exists (DBusConnection *connection,
374    if (!dbus_message_get_args (message, error,
375                                DBUS_TYPE_STRING, &name,
376                                DBUS_TYPE_INVALID))
377 -    return FALSE;
378 +    return BUS_RESULT_FALSE;
379  
380 -  retval = FALSE;
381 +  retval = BUS_RESULT_FALSE;
382  
383    if (strcmp (name, DBUS_SERVICE_DBUS) == 0)
384      {
385 @@ -926,7 +931,7 @@ bus_driver_handle_service_exists (DBusConnection *connection,
386        goto out;
387      }
388  
389 -  retval = TRUE;
390 +  retval = BUS_RESULT_TRUE;
391  
392   out:
393    if (reply)
394 @@ -935,7 +940,7 @@ bus_driver_handle_service_exists (DBusConnection *connection,
395    return retval;
396  }
397  
398 -static dbus_bool_t
399 +static BusResult
400  bus_driver_handle_activate_service (DBusConnection *connection,
401                                      BusTransaction *transaction,
402                                      DBusMessage    *message,
403 @@ -943,7 +948,7 @@ bus_driver_handle_activate_service (DBusConnection *connection,
404  {
405    dbus_uint32_t flags;
406    const char *name;
407 -  dbus_bool_t retval;
408 +  BusResult retval;
409    BusActivation *activation;
410  
411    _DBUS_ASSERT_ERROR_IS_CLEAR (error);
412 @@ -957,10 +962,10 @@ bus_driver_handle_activate_service (DBusConnection *connection,
413      {
414        _DBUS_ASSERT_ERROR_IS_SET (error);
415        _dbus_verbose ("No memory to get arguments to StartServiceByName\n");
416 -      return FALSE;
417 +      return BUS_RESULT_FALSE;
418      }
419  
420 -  retval = FALSE;
421 +  retval = BUS_RESULT_FALSE;
422  
423    if (!bus_activation_activate_service (activation, connection, transaction, FALSE,
424                                          message, name, error))
425 @@ -970,7 +975,7 @@ bus_driver_handle_activate_service (DBusConnection *connection,
426        goto out;
427      }
428  
429 -  retval = TRUE;
430 +  retval = BUS_RESULT_TRUE;
431  
432   out:
433    return retval;
434 @@ -1072,13 +1077,13 @@ bus_driver_send_or_activate (BusTransaction *transaction,
435    return TRUE;
436  }
437  
438 -static dbus_bool_t
439 +static BusResult
440  bus_driver_handle_update_activation_environment (DBusConnection *connection,
441                                                   BusTransaction *transaction,
442                                                   DBusMessage    *message,
443                                                   DBusError      *error)
444  {
445 -  dbus_bool_t retval;
446 +  BusResult retval;
447    BusActivation *activation;
448    BusContext *context;
449    DBusMessageIter iter;
450 @@ -1100,7 +1105,7 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection,
451        dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
452                        "Cannot change activation environment "
453                        "on a system bus.");
454 -      return FALSE;
455 +      return BUS_RESULT_FALSE;
456      }
457  
458    activation = bus_connection_get_activation (connection);
459 @@ -1114,7 +1119,7 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection,
460  
461    dbus_message_iter_recurse (&iter, &dict_iter);
462  
463 -  retval = FALSE;
464 +  retval = BUS_RESULT_FALSE;
465    systemd_message = NULL;
466  
467    /* Then loop through the sent dictionary, add the location of
468 @@ -1279,7 +1284,7 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection,
469    if (!bus_driver_send_ack_reply (connection, transaction, message, error))
470      goto out;
471  
472 -  retval = TRUE;
473 +  retval = BUS_RESULT_TRUE;
474  
475   out:
476    if (systemd_message != NULL)
477 @@ -1289,7 +1294,7 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection,
478    return retval;
479  }
480  
481 -static dbus_bool_t
482 +static BusResult
483  bus_driver_handle_add_match (DBusConnection *connection,
484                               BusTransaction *transaction,
485                               DBusMessage    *message,
486 @@ -1371,16 +1376,16 @@ bus_driver_handle_add_match (DBusConnection *connection,
487  
488    bus_match_rule_unref (rule);
489  
490 -  return TRUE;
491 +  return BUS_RESULT_TRUE;
492  
493   failed:
494    _DBUS_ASSERT_ERROR_IS_SET (error);
495    if (rule)
496      bus_match_rule_unref (rule);
497 -  return FALSE;
498 +  return BUS_RESULT_FALSE;
499  }
500  
501 -static dbus_bool_t
502 +static BusResult
503  bus_driver_handle_remove_match (DBusConnection *connection,
504                                  BusTransaction *transaction,
505                                  DBusMessage    *message,
506 @@ -1423,16 +1428,16 @@ bus_driver_handle_remove_match (DBusConnection *connection,
507  
508    bus_match_rule_unref (rule);
509  
510 -  return TRUE;
511 +  return BUS_RESULT_TRUE;
512  
513   failed:
514    _DBUS_ASSERT_ERROR_IS_SET (error);
515    if (rule)
516      bus_match_rule_unref (rule);
517 -  return FALSE;
518 +  return BUS_RESULT_FALSE;
519  }
520  
521 -static dbus_bool_t
522 +static BusResult
523  bus_driver_handle_get_service_owner (DBusConnection *connection,
524                                      BusTransaction *transaction,
525                                      DBusMessage    *message,
526 @@ -1502,7 +1507,7 @@ bus_driver_handle_get_service_owner (DBusConnection *connection,
527  
528    dbus_message_unref (reply);
529  
530 -  return TRUE;
531 +  return BUS_RESULT_TRUE;
532  
533   oom:
534    BUS_SET_OOM (error);
535 @@ -1511,10 +1516,10 @@ bus_driver_handle_get_service_owner (DBusConnection *connection,
536    _DBUS_ASSERT_ERROR_IS_SET (error);
537    if (reply)
538      dbus_message_unref (reply);
539 -  return FALSE;
540 +  return BUS_RESULT_FALSE;
541  }
542  
543 -static dbus_bool_t
544 +static BusResult
545  bus_driver_handle_list_queued_owners (DBusConnection *connection,
546                                       BusTransaction *transaction,
547                                       DBusMessage    *message,
548 @@ -1606,7 +1611,7 @@ bus_driver_handle_list_queued_owners (DBusConnection *connection,
549  
550    dbus_message_unref (reply);
551  
552 -  return TRUE;
553 +  return BUS_RESULT_TRUE;
554  
555   oom:
556    BUS_SET_OOM (error);
557 @@ -1619,10 +1624,10 @@ bus_driver_handle_list_queued_owners (DBusConnection *connection,
558    if (base_names)
559      _dbus_list_clear (&base_names);
560  
561 -  return FALSE;
562 +  return BUS_RESULT_FALSE;
563  }
564  
565 -static dbus_bool_t
566 +static BusResult
567  bus_driver_handle_get_connection_unix_user (DBusConnection *connection,
568                                              BusTransaction *transaction,
569                                              DBusMessage    *message,
570 @@ -1679,7 +1684,7 @@ bus_driver_handle_get_connection_unix_user (DBusConnection *connection,
571  
572    dbus_message_unref (reply);
573  
574 -  return TRUE;
575 +  return BUS_RESULT_TRUE;
576  
577   oom:
578    BUS_SET_OOM (error);
579 @@ -1688,10 +1693,10 @@ bus_driver_handle_get_connection_unix_user (DBusConnection *connection,
580    _DBUS_ASSERT_ERROR_IS_SET (error);
581    if (reply)
582      dbus_message_unref (reply);
583 -  return FALSE;
584 +  return BUS_RESULT_FALSE;
585  }
586  
587 -static dbus_bool_t
588 +static BusResult
589  bus_driver_handle_get_connection_unix_process_id (DBusConnection *connection,
590                                                   BusTransaction *transaction,
591                                                   DBusMessage    *message,
592 @@ -1748,7 +1753,7 @@ bus_driver_handle_get_connection_unix_process_id (DBusConnection *connection,
593  
594    dbus_message_unref (reply);
595  
596 -  return TRUE;
597 +  return BUS_RESULT_TRUE;
598  
599   oom:
600    BUS_SET_OOM (error);
601 @@ -1757,10 +1762,10 @@ bus_driver_handle_get_connection_unix_process_id (DBusConnection *connection,
602    _DBUS_ASSERT_ERROR_IS_SET (error);
603    if (reply)
604      dbus_message_unref (reply);
605 -  return FALSE;
606 +  return BUS_RESULT_FALSE;
607  }
608  
609 -static dbus_bool_t
610 +static BusResult
611  bus_driver_handle_get_adt_audit_session_data (DBusConnection *connection,
612                                               BusTransaction *transaction,
613                                               DBusMessage    *message,
614 @@ -1811,7 +1816,7 @@ bus_driver_handle_get_adt_audit_session_data (DBusConnection *connection,
615  
616    dbus_message_unref (reply);
617  
618 -  return TRUE;
619 +  return BUS_RESULT_TRUE;
620  
621   oom:
622    BUS_SET_OOM (error);
623 @@ -1820,10 +1825,10 @@ bus_driver_handle_get_adt_audit_session_data (DBusConnection *connection,
624    _DBUS_ASSERT_ERROR_IS_SET (error);
625    if (reply)
626      dbus_message_unref (reply);
627 -  return FALSE;
628 +  return BUS_RESULT_FALSE;
629  }
630  
631 -static dbus_bool_t
632 +static BusResult
633  bus_driver_handle_get_connection_selinux_security_context (DBusConnection *connection,
634                                                            BusTransaction *transaction,
635                                                            DBusMessage    *message,
636 @@ -1872,7 +1877,7 @@ bus_driver_handle_get_connection_selinux_security_context (DBusConnection *conne
637  
638    dbus_message_unref (reply);
639  
640 -  return TRUE;
641 +  return BUS_RESULT_TRUE;
642  
643   oom:
644    BUS_SET_OOM (error);
645 @@ -1881,10 +1886,10 @@ bus_driver_handle_get_connection_selinux_security_context (DBusConnection *conne
646    _DBUS_ASSERT_ERROR_IS_SET (error);
647    if (reply)
648      dbus_message_unref (reply);
649 -  return FALSE;
650 +  return BUS_RESULT_FALSE;
651  }
652  
653 -static dbus_bool_t
654 +static BusResult
655  bus_driver_handle_get_connection_credentials (DBusConnection *connection,
656                                                BusTransaction *transaction,
657                                                DBusMessage    *message,
658 @@ -1998,7 +2003,7 @@ bus_driver_handle_get_connection_credentials (DBusConnection *connection,
659  
660    dbus_message_unref (reply);
661  
662 -  return TRUE;
663 +  return BUS_RESULT_TRUE;
664  
665   oom:
666    BUS_SET_OOM (error);
667 @@ -2012,10 +2017,10 @@ bus_driver_handle_get_connection_credentials (DBusConnection *connection,
668        dbus_message_unref (reply);
669      }
670  
671 -  return FALSE;
672 +  return BUS_RESULT_FALSE;
673  }
674  
675 -static dbus_bool_t
676 +static BusResult
677  bus_driver_handle_reload_config (DBusConnection *connection,
678                                  BusTransaction *transaction,
679                                  DBusMessage    *message,
680 @@ -2040,7 +2045,7 @@ bus_driver_handle_reload_config (DBusConnection *connection,
681      goto oom;
682  
683    dbus_message_unref (reply);
684 -  return TRUE;
685 +  return BUS_RESULT_TRUE;
686  
687   oom:
688    BUS_SET_OOM (error);
689 @@ -2049,11 +2054,11 @@ bus_driver_handle_reload_config (DBusConnection *connection,
690    _DBUS_ASSERT_ERROR_IS_SET (error);
691    if (reply)
692      dbus_message_unref (reply);
693 -  return FALSE;
694 +  return BUS_RESULT_FALSE;
695  }
696  
697  #ifdef DBUS_ENABLE_VERBOSE_MODE
698 -static dbus_bool_t
699 +static BusResult
700  bus_driver_handle_enable_verbose (DBusConnection *connection,
701                                    BusTransaction *transaction,
702                                    DBusMessage    *message,
703 @@ -2073,7 +2078,7 @@ bus_driver_handle_enable_verbose (DBusConnection *connection,
704      _dbus_set_verbose(TRUE);
705  
706      dbus_message_unref (reply);
707 -    return TRUE;
708 +    return BUS_RESULT_TRUE;
709  
710     oom:
711      _DBUS_ASSERT_ERROR_IS_CLEAR (error);
712 @@ -2082,10 +2087,10 @@ bus_driver_handle_enable_verbose (DBusConnection *connection,
713  
714      if (reply)
715        dbus_message_unref (reply);
716 -    return FALSE;
717 +    return BUS_RESULT_FALSE;
718  }
719  
720 -static dbus_bool_t
721 +static BusResult
722  bus_driver_handle_disable_verbose (DBusConnection *connection,
723                                     BusTransaction *transaction,
724                                     DBusMessage    *message,
725 @@ -2105,7 +2110,7 @@ bus_driver_handle_disable_verbose (DBusConnection *connection,
726      _dbus_set_verbose(FALSE);
727  
728      dbus_message_unref (reply);
729 -    return TRUE;
730 +    return BUS_RESULT_TRUE;
731  
732     oom:
733      _DBUS_ASSERT_ERROR_IS_CLEAR (error);
734 @@ -2114,11 +2119,11 @@ bus_driver_handle_disable_verbose (DBusConnection *connection,
735  
736      if (reply)
737        dbus_message_unref (reply);
738 -    return FALSE;
739 +    return BUS_RESULT_FALSE;
740  }
741  #endif
742  
743 -static dbus_bool_t
744 +static BusResult
745  bus_driver_handle_get_id (DBusConnection *connection,
746                            BusTransaction *transaction,
747                            DBusMessage    *message,
748 @@ -2134,7 +2139,7 @@ bus_driver_handle_get_id (DBusConnection *connection,
749    if (!_dbus_string_init (&uuid))
750      {
751        BUS_SET_OOM (error);
752 -      return FALSE;
753 +      return BUS_RESULT_FALSE;
754      }
755  
756    reply = NULL;
757 @@ -2160,7 +2165,7 @@ bus_driver_handle_get_id (DBusConnection *connection,
758  
759    _dbus_string_free (&uuid);
760    dbus_message_unref (reply);
761 -  return TRUE;
762 +  return BUS_RESULT_TRUE;
763  
764   oom:
765    _DBUS_ASSERT_ERROR_IS_CLEAR (error);
766 @@ -2170,10 +2175,10 @@ bus_driver_handle_get_id (DBusConnection *connection,
767    if (reply)
768      dbus_message_unref (reply);
769    _dbus_string_free (&uuid);
770 -  return FALSE;
771 +  return BUS_RESULT_FALSE;
772  }
773  
774 -static dbus_bool_t
775 +static BusResult
776  bus_driver_handle_become_monitor (DBusConnection *connection,
777                                    BusTransaction *transaction,
778                                    DBusMessage    *message,
779 @@ -2189,7 +2194,7 @@ bus_driver_handle_become_monitor (DBusConnection *connection,
780    int i;
781    int n_match_rules;
782    dbus_uint32_t flags;
783 -  dbus_bool_t ret = FALSE;
784 +  BusResult ret = BUS_RESULT_FALSE;
785  
786    _DBUS_ASSERT_ERROR_IS_CLEAR (error);
787  
788 @@ -2262,10 +2267,10 @@ bus_driver_handle_become_monitor (DBusConnection *connection,
789    if (!bus_connection_be_monitor (connection, transaction, &rules, error))
790      goto out;
791  
792 -  ret = TRUE;
793 +  ret = BUS_RESULT_TRUE;
794  
795  out:
796 -  if (ret)
797 +  if (ret == BUS_RESULT_TRUE)
798      _DBUS_ASSERT_ERROR_IS_CLEAR (error);
799    else
800      _DBUS_ASSERT_ERROR_IS_SET (error);
801 @@ -2389,10 +2394,10 @@ typedef struct
802    const char *name;
803    const char *in_args;
804    const char *out_args;
805 -  dbus_bool_t (* handler) (DBusConnection *connection,
806 -                           BusTransaction *transaction,
807 -                           DBusMessage    *message,
808 -                           DBusError      *error);
809 +  BusResult (* handler) (DBusConnection *connection,
810 +                         BusTransaction *transaction,
811 +                         DBusMessage    *message,
812 +                         DBusError      *error);
813    MethodFlags flags;
814  } MessageHandler;
815  
816 @@ -2511,7 +2516,7 @@ static const PropertyHandler dbus_property_handlers[] = {
817    { NULL, NULL, NULL }
818  };
819  
820 -static dbus_bool_t bus_driver_handle_introspect (DBusConnection *,
821 +static BusResult bus_driver_handle_introspect (DBusConnection *,
822      BusTransaction *, DBusMessage *, DBusError *);
823  
824  static const MessageHandler properties_message_handlers[] = {
825 @@ -2763,7 +2768,7 @@ bus_driver_generate_introspect_string (DBusString *xml,
826    return TRUE;
827  }
828  
829 -static dbus_bool_t
830 +static BusResult
831  bus_driver_handle_introspect (DBusConnection *connection,
832                                BusTransaction *transaction,
833                                DBusMessage    *message,
834 @@ -2784,13 +2789,13 @@ bus_driver_handle_introspect (DBusConnection *connection,
835                                DBUS_TYPE_INVALID))
836      {
837        _DBUS_ASSERT_ERROR_IS_SET (error);
838 -      return FALSE;
839 +      return BUS_RESULT_FALSE;
840      }
841  
842    if (!_dbus_string_init (&xml))
843      {
844        BUS_SET_OOM (error);
845 -      return FALSE;
846 +      return BUS_RESULT_FALSE;
847      }
848  
849    is_canonical_path = dbus_message_has_path (message, DBUS_PATH_DBUS);
850 @@ -2815,7 +2820,7 @@ bus_driver_handle_introspect (DBusConnection *connection,
851    dbus_message_unref (reply);
852    _dbus_string_free (&xml);
853  
854 -  return TRUE;
855 +  return BUS_RESULT_TRUE;
856  
857   oom:
858    BUS_SET_OOM (error);
859 @@ -2825,10 +2830,10 @@ bus_driver_handle_introspect (DBusConnection *connection,
860  
861    _dbus_string_free (&xml);
862  
863 -  return FALSE;
864 +  return BUS_RESULT_FALSE;
865  }
866  
867 -dbus_bool_t
868 +BusResult
869  bus_driver_handle_message (DBusConnection *connection,
870                             BusTransaction *transaction,
871                            DBusMessage    *message,
872 @@ -2839,6 +2844,7 @@ bus_driver_handle_message (DBusConnection *connection,
873    const MessageHandler *mh;
874    dbus_bool_t found_interface = FALSE;
875    dbus_bool_t is_canonical_path;
876 +  BusResult res;
877  
878    _DBUS_ASSERT_ERROR_IS_CLEAR (error);
879  
880 @@ -2854,7 +2860,7 @@ bus_driver_handle_message (DBusConnection *connection,
881                                                    transaction,
882                                                    message,
883                                                    error))
884 -        return FALSE;
885 +        return BUS_RESULT_FALSE;
886  
887        context = bus_connection_get_context (connection);
888        systemd = bus_driver_get_owner_of_name (connection,
889 @@ -2871,7 +2877,7 @@ bus_driver_handle_message (DBusConnection *connection,
890                             attacker ? attacker : "(unauthenticated)",
891                             bus_connection_get_loginfo (connection));
892            /* ignore it */
893 -          return TRUE;
894 +          return BUS_RESULT_TRUE;
895          }
896  
897        if (!bus_context_get_systemd_activation (context))
898 @@ -2879,16 +2885,16 @@ bus_driver_handle_message (DBusConnection *connection,
899            bus_context_log (context, DBUS_SYSTEM_LOG_WARNING,
900                             "Ignoring unexpected ActivationFailure message "
901                             "while not using systemd activation");
902 -          return FALSE;
903 +          return BUS_RESULT_FALSE;
904          }
905  
906 -      return dbus_activation_systemd_failure(bus_context_get_activation(context), message);
907 +      return dbus_activation_systemd_failure(bus_context_get_activation(context), message) == TRUE ? BUS_RESULT_TRUE : BUS_RESULT_FALSE;
908      }
909  
910    if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_METHOD_CALL)
911      {
912        _dbus_verbose ("Driver got a non-method-call message, ignoring\n");
913 -      return TRUE; /* we just ignore this */
914 +      return BUS_RESULT_TRUE; /* we just ignore this */
915      }
916  
917    /* may be NULL, which means "any interface will do" */
918 @@ -2953,20 +2959,27 @@ bus_driver_handle_message (DBusConnection *connection,
919                                name, dbus_message_get_signature (message),
920                                mh->in_args);
921                _DBUS_ASSERT_ERROR_IS_SET (error);
922 -              return FALSE;
923 +              return BUS_RESULT_FALSE;
924              }
925  
926 -          if ((* mh->handler) (connection, transaction, message, error))
927 +          res = (* mh->handler) (connection, transaction, message, error);
928 +          if (res == BUS_RESULT_TRUE)
929              {
930                _DBUS_ASSERT_ERROR_IS_CLEAR (error);
931                _dbus_verbose ("Driver handler succeeded\n");
932 -              return TRUE;
933 +              return BUS_RESULT_TRUE;
934              }
935 -          else
936 +          else if (res == BUS_RESULT_FALSE)
937              {
938                _DBUS_ASSERT_ERROR_IS_SET (error);
939                _dbus_verbose ("Driver handler returned failure\n");
940 -              return FALSE;
941 +              return BUS_RESULT_FALSE;
942 +            }
943 +          else if (res == BUS_RESULT_LATER)
944 +            {
945 +              _DBUS_ASSERT_ERROR_IS_CLEAR (error);
946 +              _dbus_verbose ("Driver handler delayed message processing due to policy check\n");
947 +              return BUS_RESULT_LATER;
948              }
949          }
950      }
951 @@ -2978,7 +2991,7 @@ bus_driver_handle_message (DBusConnection *connection,
952                    "%s does not understand message %s",
953                    DBUS_SERVICE_DBUS, name);
954  
955 -  return FALSE;
956 +  return BUS_RESULT_FALSE;
957  }
958  
959  void
960 diff --git a/bus/driver.h b/bus/driver.h
961 index ac1289d..183c28b 100644
962 --- a/bus/driver.h
963 +++ b/bus/driver.h
964 @@ -35,7 +35,7 @@ typedef enum
965  } BusDriverFound;
966  
967  void        bus_driver_remove_connection     (DBusConnection *connection);
968 -dbus_bool_t bus_driver_handle_message        (DBusConnection *connection,
969 +BusResult   bus_driver_handle_message        (DBusConnection *connection,
970                                                BusTransaction *transaction,
971                                                DBusMessage    *message,
972                                                DBusError      *error);
973 diff --git a/bus/policy.c b/bus/policy.c
974 index b1fab0d..27b66d1 100644
975 --- a/bus/policy.c
976 +++ b/bus/policy.c
977 @@ -1388,18 +1388,21 @@ bus_client_policy_check_can_receive (BusClientPolicy     *policy,
978  
979  
980  
981 -static dbus_bool_t
982 +static BusResult
983  bus_rules_check_can_own (DBusList *rules,
984 -                         const DBusString *service_name)
985 +                         const DBusString *service_name,
986 +                         DBusConnection   *connection,
987 +                         DBusMessage      *message)
988  {
989    DBusList *link;
990 -  dbus_bool_t allowed;
991 +  BusResult result;
992 +  const char *privilege;
993    
994    /* rules is in the order the rules appeared
995     * in the config file, i.e. last rule that applies wins
996     */
997  
998 -  allowed = FALSE;
999 +  result = BUS_RESULT_FALSE;
1000    link = _dbus_list_get_first_link (&rules);
1001    while (link != NULL)
1002      {
1003 @@ -1435,17 +1438,45 @@ bus_rules_check_can_own (DBusList *rules,
1004          }
1005  
1006        /* Use this rule */
1007 -      allowed = rule->access == BUS_POLICY_RULE_ACCESS_ALLOW;
1008 +      switch (rule->access)
1009 +      {
1010 +      case BUS_POLICY_RULE_ACCESS_ALLOW:
1011 +        result = BUS_RESULT_TRUE;
1012 +        break;
1013 +      case BUS_POLICY_RULE_ACCESS_DENY:
1014 +        result = BUS_RESULT_FALSE;
1015 +        break;
1016 +      case BUS_POLICY_RULE_ACCESS_CHECK:
1017 +        result = BUS_RESULT_LATER;
1018 +        privilege = rule->privilege;
1019 +        break;
1020 +      }
1021      }
1022  
1023 -  return allowed;
1024 +  if (result == BUS_RESULT_LATER)
1025 +    {
1026 +      BusContext *context = bus_connection_get_context(connection);
1027 +      BusCheck *check = bus_context_get_check(context);
1028 +      BusDeferredMessage *deferred_message;
1029 +
1030 +      result = bus_check_privilege(check, message, connection, NULL, NULL,
1031 +          privilege, BUS_DEFERRED_MESSAGE_CHECK_OWN, &deferred_message);
1032 +      if (result == BUS_RESULT_LATER)
1033 +        {
1034 +          bus_deferred_message_disable_sender(deferred_message);
1035 +        }
1036 +    }
1037 +
1038 +  return result;
1039  }
1040  
1041 -dbus_bool_t
1042 +BusResult
1043  bus_client_policy_check_can_own (BusClientPolicy  *policy,
1044 -                                 const DBusString *service_name)
1045 +                                 const DBusString *service_name,
1046 +                                 DBusConnection   *connection,
1047 +                                 DBusMessage      *message)
1048  {
1049 -  return bus_rules_check_can_own (policy->rules, service_name);
1050 +  return bus_rules_check_can_own (policy->rules, service_name, connection, message);
1051  }
1052  
1053  #ifdef DBUS_ENABLE_EMBEDDED_TESTS
1054 @@ -1453,7 +1484,7 @@ dbus_bool_t
1055  bus_policy_check_can_own (BusPolicy  *policy,
1056                            const DBusString *service_name)
1057  {
1058 -  return bus_rules_check_can_own (policy->default_rules, service_name);
1059 +  return bus_rules_check_can_own (policy->default_rules, service_name, NULL, NULL) == BUS_RESULT_TRUE;
1060  }
1061  #endif /* DBUS_ENABLE_EMBEDDED_TESTS */
1062  
1063 diff --git a/bus/policy.h b/bus/policy.h
1064 index f306a3c..39d7cc5 100644
1065 --- a/bus/policy.h
1066 +++ b/bus/policy.h
1067 @@ -182,8 +182,10 @@ BusResult        bus_client_policy_check_can_receive (BusClientPolicy     *polic
1068                                                        dbus_int32_t        *toggles,
1069                                                        const char         **privilege_param,
1070                                                        BusDeferredMessage **deferred_message);
1071 -dbus_bool_t      bus_client_policy_check_can_own     (BusClientPolicy  *policy,
1072 -                                                      const DBusString *service_name);
1073 +BusResult        bus_client_policy_check_can_own     (BusClientPolicy  *policy,
1074 +                                                      const DBusString *service_name,
1075 +                                                      DBusConnection   *connection,
1076 +                                                      DBusMessage      *message);
1077  dbus_bool_t      bus_client_policy_append_rule       (BusClientPolicy  *policy,
1078                                                        BusPolicyRule    *rule);
1079  void             bus_client_policy_optimize          (BusClientPolicy  *policy);
1080 diff --git a/bus/services.c b/bus/services.c
1081 index 127edda..586af18 100644
1082 --- a/bus/services.c
1083 +++ b/bus/services.c
1084 @@ -376,16 +376,17 @@ bus_registry_list_services (BusRegistry *registry,
1085    return FALSE;
1086  }
1087  
1088 -dbus_bool_t
1089 +BusResult
1090  bus_registry_acquire_service (BusRegistry      *registry,
1091                                DBusConnection   *connection,
1092 +                              DBusMessage      *message,
1093                                const DBusString *service_name,
1094                                dbus_uint32_t     flags,
1095                                dbus_uint32_t    *result,
1096                                BusTransaction   *transaction,
1097                                DBusError        *error)
1098  {
1099 -  dbus_bool_t retval;
1100 +  BusResult retval;
1101    DBusConnection *old_owner_conn;
1102    BusClientPolicy *policy;
1103    BusService *service;
1104 @@ -393,8 +394,9 @@ bus_registry_acquire_service (BusRegistry      *registry,
1105    BusSELinuxID *sid;
1106    BusOwner *primary_owner;
1107    int limit;
1108 +  BusResult res;
1109  
1110 -  retval = FALSE;
1111 +  retval = BUS_RESULT_FALSE;
1112  
1113    if (!_dbus_validate_bus_name (service_name, 0,
1114                                  _dbus_string_get_length (service_name)))
1115 @@ -467,7 +469,8 @@ bus_registry_acquire_service (BusRegistry      *registry,
1116                                              _dbus_string_get_const_data (service_name), error))
1117      goto out;
1118    
1119 -  if (!bus_client_policy_check_can_own (policy, service_name))
1120 +  res = bus_client_policy_check_can_own (policy, service_name, connection, message);
1121 +  if (res == BUS_RESULT_FALSE)
1122      {
1123        dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
1124                        "Connection \"%s\" is not allowed to own the service \"%s\" due "
1125 @@ -478,6 +481,11 @@ bus_registry_acquire_service (BusRegistry      *registry,
1126                        _dbus_string_get_const_data (service_name));
1127        goto out;
1128      }
1129 +  else if (res == BUS_RESULT_LATER)
1130 +    {
1131 +      retval = BUS_RESULT_LATER;
1132 +      goto out;
1133 +    }
1134  
1135    limit = bus_context_get_max_services_per_connection (registry->context);
1136  
1137 @@ -603,11 +611,13 @@ bus_registry_acquire_service (BusRegistry      *registry,
1138      }
1139  
1140    activation = bus_context_get_activation (registry->context);
1141 -  retval = bus_activation_send_pending_auto_activation_messages (activation,
1142 +  
1143 +  if (bus_activation_send_pending_auto_activation_messages (activation,
1144                                                                  service,
1145 -                                                                transaction);
1146 -  if (!retval)
1147 -    BUS_SET_OOM (error);
1148 +                                                                transaction))
1149 +      retval = BUS_RESULT_TRUE;
1150 +  else
1151 +      BUS_SET_OOM (error);
1152    
1153   out:
1154    return retval;
1155 diff --git a/bus/services.h b/bus/services.h
1156 index 056dd9f..3df3dd7 100644
1157 --- a/bus/services.h
1158 +++ b/bus/services.h
1159 @@ -50,8 +50,9 @@ void         bus_registry_foreach         (BusRegistry                 *registry
1160  dbus_bool_t  bus_registry_list_services   (BusRegistry                 *registry,
1161                                             char                      ***listp,
1162                                             int                         *array_len);
1163 -dbus_bool_t  bus_registry_acquire_service (BusRegistry                 *registry,
1164 +BusResult    bus_registry_acquire_service (BusRegistry                 *registry,
1165                                             DBusConnection              *connection,
1166 +                                           DBusMessage                 *message,
1167                                             const DBusString            *service_name,
1168                                             dbus_uint32_t                flags,
1169                                             dbus_uint32_t               *result,
1170 diff --git a/bus/stats.c b/bus/stats.c
1171 index 1582255..4ba72d6 100644
1172 --- a/bus/stats.c
1173 +++ b/bus/stats.c
1174 @@ -36,7 +36,7 @@
1175  
1176  #ifdef DBUS_ENABLE_STATS
1177  
1178 -dbus_bool_t
1179 +BusResult
1180  bus_stats_handle_get_stats (DBusConnection *connection,
1181                              BusTransaction *transaction,
1182                              DBusMessage    *message,
1183 @@ -104,17 +104,17 @@ bus_stats_handle_get_stats (DBusConnection *connection,
1184      goto oom;
1185  
1186    dbus_message_unref (reply);
1187 -  return TRUE;
1188 +  return BUS_RESULT_TRUE;
1189  
1190  oom:
1191    if (reply != NULL)
1192      dbus_message_unref (reply);
1193  
1194    BUS_SET_OOM (error);
1195 -  return FALSE;
1196 +  return BUS_RESULT_FALSE;
1197  }
1198  
1199 -dbus_bool_t
1200 +BusResult
1201  bus_stats_handle_get_connection_stats (DBusConnection *caller_connection,
1202                                         BusTransaction *transaction,
1203                                         DBusMessage    *message,
1204 @@ -209,7 +209,7 @@ bus_stats_handle_get_connection_stats (DBusConnection *caller_connection,
1205      goto oom;
1206  
1207    dbus_message_unref (reply);
1208 -  return TRUE;
1209 +  return BUS_RESULT_TRUE;
1210  
1211  oom:
1212    BUS_SET_OOM (error);
1213 @@ -218,11 +218,11 @@ failed:
1214    if (reply != NULL)
1215      dbus_message_unref (reply);
1216  
1217 -  return FALSE;
1218 +  return BUS_RESULT_FALSE;
1219  }
1220  
1221  
1222 -dbus_bool_t
1223 +BusResult
1224  bus_stats_handle_get_all_match_rules (DBusConnection *caller_connection,
1225                                        BusTransaction *transaction,
1226                                        DBusMessage    *message,
1227 @@ -246,7 +246,7 @@ bus_stats_handle_get_all_match_rules (DBusConnection *caller_connection,
1228    matchmaker = bus_context_get_matchmaker (context);
1229  
1230    if (!bus_registry_list_services (registry, &services, &services_len))
1231 -    return FALSE;
1232 +    return BUS_RESULT_FALSE;
1233  
1234    reply = dbus_message_new_method_return (message);
1235    if (reply == NULL)
1236 @@ -325,7 +325,7 @@ bus_stats_handle_get_all_match_rules (DBusConnection *caller_connection,
1237  
1238    dbus_message_unref (reply);
1239    dbus_free_string_array (services);
1240 -  return TRUE;
1241 +  return BUS_RESULT_TRUE;
1242  
1243  oom:
1244    if (reply != NULL)
1245 @@ -334,7 +334,7 @@ oom:
1246    dbus_free_string_array (services);
1247  
1248    BUS_SET_OOM (error);
1249 -  return FALSE;
1250 +  return BUS_RESULT_FALSE;
1251  }
1252  
1253  #endif
1254 diff --git a/bus/stats.h b/bus/stats.h
1255 index dcb022c..683fa17 100644
1256 --- a/bus/stats.h
1257 +++ b/bus/stats.h
1258 @@ -25,17 +25,17 @@
1259  
1260  #define BUS_INTERFACE_STATS "org.freedesktop.DBus.Debug.Stats"
1261  
1262 -dbus_bool_t bus_stats_handle_get_stats (DBusConnection *connection,
1263 +BusResult bus_stats_handle_get_stats (DBusConnection *connection,
1264                                          BusTransaction *transaction,
1265                                          DBusMessage    *message,
1266                                          DBusError      *error);
1267  
1268 -dbus_bool_t bus_stats_handle_get_connection_stats (DBusConnection *connection,
1269 +BusResult bus_stats_handle_get_connection_stats (DBusConnection *connection,
1270                                                     BusTransaction *transaction,
1271                                                     DBusMessage    *message,
1272                                                     DBusError      *error);
1273  
1274 -dbus_bool_t bus_stats_handle_get_all_match_rules (DBusConnection *caller_connection,
1275 +BusResult bus_stats_handle_get_all_match_rules (DBusConnection *caller_connection,
1276                                                    BusTransaction *transaction,
1277                                                    DBusMessage    *message,
1278                                                    DBusError      *error);