1 /* -*- mode: C; c-file-style: "gnu" -*- */
2 /* bus.c message bus context object
4 * Copyright (C) 2003, 2004 Red Hat, Inc.
6 * Licensed under the Academic Free License version 2.0
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "activation.h"
26 #include "connection.h"
30 #include "config-parser.h"
32 #include <dbus/dbus-list.h>
33 #include <dbus/dbus-hash.h>
34 #include <dbus/dbus-internals.h>
46 BusConnections *connections;
47 BusActivation *activation;
48 BusRegistry *registry;
50 BusMatchmaker *matchmaker;
51 DBusUserDatabase *user_database;
53 unsigned int fork : 1;
56 static dbus_int32_t server_data_slot = -1;
63 #define BUS_SERVER_DATA(server) (dbus_server_get_data ((server), server_data_slot))
66 server_get_context (DBusServer *server)
71 if (!dbus_server_allocate_data_slot (&server_data_slot))
74 bd = BUS_SERVER_DATA (server);
77 dbus_server_free_data_slot (&server_data_slot);
81 context = bd->context;
83 dbus_server_free_data_slot (&server_data_slot);
89 server_watch_callback (DBusWatch *watch,
90 unsigned int condition,
93 /* FIXME this can be done in dbus-mainloop.c
94 * if the code in activation.c for the babysitter
95 * watch handler is fixed.
98 return dbus_watch_handle (watch, condition);
102 add_server_watch (DBusWatch *watch,
105 DBusServer *server = data;
108 context = server_get_context (server);
110 return _dbus_loop_add_watch (context->loop,
111 watch, server_watch_callback, server,
116 remove_server_watch (DBusWatch *watch,
119 DBusServer *server = data;
122 context = server_get_context (server);
124 _dbus_loop_remove_watch (context->loop,
125 watch, server_watch_callback, server);
130 server_timeout_callback (DBusTimeout *timeout,
133 /* can return FALSE on OOM but we just let it fire again later */
134 dbus_timeout_handle (timeout);
138 add_server_timeout (DBusTimeout *timeout,
141 DBusServer *server = data;
144 context = server_get_context (server);
146 return _dbus_loop_add_timeout (context->loop,
147 timeout, server_timeout_callback, server, NULL);
151 remove_server_timeout (DBusTimeout *timeout,
154 DBusServer *server = data;
157 context = server_get_context (server);
159 _dbus_loop_remove_timeout (context->loop,
160 timeout, server_timeout_callback, server);
164 new_connection_callback (DBusServer *server,
165 DBusConnection *new_connection,
168 BusContext *context = data;
170 if (!bus_connections_setup_connection (context->connections, new_connection))
172 _dbus_verbose ("No memory to setup new connection\n");
174 /* if we don't do this, it will get unref'd without
175 * being disconnected... kind of strange really
176 * that we have to do this, people won't get it right
179 dbus_connection_disconnect (new_connection);
182 dbus_connection_set_max_received_size (new_connection,
183 context->limits.max_incoming_bytes);
185 dbus_connection_set_max_message_size (new_connection,
186 context->limits.max_message_size);
188 /* on OOM, we won't have ref'd the connection so it will die. */
192 free_server_data (void *data)
194 BusServerData *bd = data;
200 setup_server (BusContext *context,
202 char **auth_mechanisms,
207 bd = dbus_new0 (BusServerData, 1);
208 if (!dbus_server_set_data (server,
210 bd, free_server_data))
217 bd->context = context;
219 if (!dbus_server_set_auth_mechanisms (server, (const char**) auth_mechanisms))
225 dbus_server_set_new_connection_function (server,
226 new_connection_callback,
229 if (!dbus_server_set_watch_functions (server,
240 if (!dbus_server_set_timeout_functions (server,
242 remove_server_timeout,
253 /* This code only gets executed the first time the
254 config files are parsed. It is not executed
255 when config files are reloaded.*/
257 process_config_first_time_only (BusContext *context,
258 BusConfigParser *parser,
262 DBusList **addresses;
263 const char *user, *pidfile;
264 char **auth_mechanisms;
265 DBusList **auth_mechanisms_list;
269 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
272 auth_mechanisms = NULL;
274 /* Check for an existing pid file. Of course this is a race;
275 * we'd have to use fcntl() locks on the pid file to
276 * avoid that. But we want to check for the pid file
277 * before overwriting any existing sockets, etc.
279 pidfile = bus_config_parser_get_pidfile (parser);
286 dbus_error_init (&tmp_error);
287 _dbus_string_init_const (&u, pidfile);
289 if (_dbus_stat (&u, &stbuf, &tmp_error))
291 dbus_set_error (error, DBUS_ERROR_FAILED,
292 "The pid file \"%s\" exists, if the message bus is not running, remove this file",
294 dbus_error_free (&tmp_error);
299 /* keep around the pid filename so we can delete it later */
300 context->pidfile = _dbus_strdup (pidfile);
302 /* Build an array of auth mechanisms */
304 auth_mechanisms_list = bus_config_parser_get_mechanisms (parser);
305 len = _dbus_list_get_length (auth_mechanisms_list);
311 auth_mechanisms = dbus_new0 (char*, len + 1);
312 if (auth_mechanisms == NULL)
319 link = _dbus_list_get_first_link (auth_mechanisms_list);
322 auth_mechanisms[i] = _dbus_strdup (link->data);
323 if (auth_mechanisms[i] == NULL)
328 link = _dbus_list_get_next_link (auth_mechanisms_list, link);
333 auth_mechanisms = NULL;
336 /* Listen on our addresses */
338 addresses = bus_config_parser_get_addresses (parser);
340 link = _dbus_list_get_first_link (addresses);
345 server = dbus_server_listen (link->data, error);
348 _DBUS_ASSERT_ERROR_IS_SET (error);
351 else if (!setup_server (context, server, auth_mechanisms, error))
353 _DBUS_ASSERT_ERROR_IS_SET (error);
357 if (!_dbus_list_append (&context->servers, server))
363 link = _dbus_list_get_next_link (addresses, link);
366 /* note that type may be NULL */
367 context->type = _dbus_strdup (bus_config_parser_get_type (parser));
368 if (bus_config_parser_get_type (parser) != NULL && context->type == NULL)
374 user = bus_config_parser_get_user (parser);
377 context->user = _dbus_strdup (user);
378 if (context->user == NULL)
385 context->fork = bus_config_parser_get_fork (parser);
387 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
391 dbus_free_string_array (auth_mechanisms);
395 /* This code gets executed every time the config files
396 are parsed: both during BusContext construction
399 process_config_every_time (BusContext *context,
400 BusConfigParser *parser,
401 dbus_bool_t is_reload,
404 DBusString full_address;
409 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
413 if (!_dbus_string_init (&full_address))
419 /* get our limits and timeout lengths */
420 bus_config_parser_get_limits (parser, &context->limits);
422 context->policy = bus_config_parser_steal_policy (parser);
423 _dbus_assert (context->policy != NULL);
425 /* We have to build the address backward, so that
426 * <listen> later in the config file have priority
428 link = _dbus_list_get_last_link (&context->servers);
433 addr = dbus_server_get_address (link->data);
440 if (_dbus_string_get_length (&full_address) > 0)
442 if (!_dbus_string_append (&full_address, ";"))
449 if (!_dbus_string_append (&full_address, addr))
457 link = _dbus_list_get_prev_link (&context->servers, link);
461 dbus_free (context->address);
463 if (!_dbus_string_copy_data (&full_address, &context->address))
469 /* Create activation subsystem */
472 bus_activation_unref (context->activation);
474 context->activation = bus_activation_new (context, &full_address,
475 bus_config_parser_get_service_dirs (parser),
477 if (context->activation == NULL)
479 _DBUS_ASSERT_ERROR_IS_SET (error);
483 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
487 _dbus_string_free (&full_address);
492 load_config (BusContext *context,
493 dbus_bool_t is_reload,
496 BusConfigParser *parser;
497 DBusString config_file;
500 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
505 _dbus_string_init_const (&config_file, context->config_file);
506 parser = bus_config_load (&config_file, TRUE, NULL, error);
509 _DBUS_ASSERT_ERROR_IS_SET (error);
513 if (!is_reload && !process_config_first_time_only (context, parser, error))
515 _DBUS_ASSERT_ERROR_IS_SET (error);
519 if (!process_config_every_time (context, parser, is_reload, error))
521 _DBUS_ASSERT_ERROR_IS_SET (error);
525 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
530 bus_config_parser_unref (parser);
535 bus_context_new (const DBusString *config_file,
536 dbus_bool_t force_fork,
543 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
545 if (!dbus_server_allocate_data_slot (&server_data_slot))
551 context = dbus_new0 (BusContext, 1);
557 context->refcount = 1;
559 if (!_dbus_string_copy_data (config_file, &context->config_file))
565 context->loop = _dbus_loop_new ();
566 if (context->loop == NULL)
572 if (!load_config (context, FALSE, error))
574 _DBUS_ASSERT_ERROR_IS_SET (error);
578 /* we need another ref of the server data slot for the context
581 if (!dbus_server_allocate_data_slot (&server_data_slot))
582 _dbus_assert_not_reached ("second ref of server data slot failed");
584 context->user_database = _dbus_user_database_new ();
585 if (context->user_database == NULL)
591 /* Note that we don't know whether the print_addr_fd is
592 * one of the sockets we're using to listen on, or some
593 * other random thing. But I think the answer is "don't do
596 if (print_addr_fd >= 0)
599 const char *a = bus_context_get_address (context);
602 _dbus_assert (a != NULL);
603 if (!_dbus_string_init (&addr))
609 if (!_dbus_string_append (&addr, a) ||
610 !_dbus_string_append (&addr, "\n"))
612 _dbus_string_free (&addr);
617 bytes = _dbus_string_get_length (&addr);
618 if (_dbus_write (print_addr_fd, &addr, 0, bytes) != bytes)
620 dbus_set_error (error, DBUS_ERROR_FAILED,
621 "Printing message bus address: %s\n",
622 _dbus_strerror (errno));
623 _dbus_string_free (&addr);
627 if (print_addr_fd > 2)
628 _dbus_close (print_addr_fd, NULL);
630 _dbus_string_free (&addr);
633 context->connections = bus_connections_new (context);
634 if (context->connections == NULL)
640 context->registry = bus_registry_new (context);
641 if (context->registry == NULL)
647 context->matchmaker = bus_matchmaker_new ();
648 if (context->matchmaker == NULL)
654 /* Now become a daemon if appropriate */
655 if (force_fork || context->fork)
659 if (context->pidfile)
660 _dbus_string_init_const (&u, context->pidfile);
662 if (!_dbus_become_daemon (context->pidfile ? &u : NULL, error))
664 _DBUS_ASSERT_ERROR_IS_SET (error);
670 /* Need to write PID file for ourselves, not for the child process */
671 if (context->pidfile != NULL)
675 _dbus_string_init_const (&u, context->pidfile);
677 if (!_dbus_write_pid_file (&u, _dbus_getpid (), error))
679 _DBUS_ASSERT_ERROR_IS_SET (error);
685 /* Write PID if requested */
686 if (print_pid_fd >= 0)
691 if (!_dbus_string_init (&pid))
697 if (!_dbus_string_append_int (&pid, _dbus_getpid ()) ||
698 !_dbus_string_append (&pid, "\n"))
700 _dbus_string_free (&pid);
705 bytes = _dbus_string_get_length (&pid);
706 if (_dbus_write (print_pid_fd, &pid, 0, bytes) != bytes)
708 dbus_set_error (error, DBUS_ERROR_FAILED,
709 "Printing message bus PID: %s\n",
710 _dbus_strerror (errno));
711 _dbus_string_free (&pid);
715 if (print_pid_fd > 2)
716 _dbus_close (print_pid_fd, NULL);
718 _dbus_string_free (&pid);
721 /* Here we change our credentials if required,
722 * as soon as we've set up our sockets and pidfile
724 if (context->user != NULL)
726 DBusCredentials creds;
729 _dbus_string_init_const (&u, context->user);
731 if (!_dbus_credentials_from_username (&u, &creds) ||
735 dbus_set_error (error, DBUS_ERROR_FAILED,
736 "Could not get UID and GID for username \"%s\"",
741 if (!_dbus_change_identity (creds.uid, creds.gid, error))
743 _DBUS_ASSERT_ERROR_IS_SET (error);
748 dbus_server_free_data_slot (&server_data_slot);
754 bus_context_unref (context);
756 if (server_data_slot >= 0)
757 dbus_server_free_data_slot (&server_data_slot);
763 bus_context_reload_config (BusContext *context,
766 return load_config (context,
767 TRUE, /* yes, we are re-loading */
772 shutdown_server (BusContext *context,
775 if (server == NULL ||
776 !dbus_server_get_is_connected (server))
779 if (!dbus_server_set_watch_functions (server,
783 _dbus_assert_not_reached ("setting watch functions to NULL failed");
785 if (!dbus_server_set_timeout_functions (server,
789 _dbus_assert_not_reached ("setting timeout functions to NULL failed");
791 dbus_server_disconnect (server);
795 bus_context_shutdown (BusContext *context)
799 link = _dbus_list_get_first_link (&context->servers);
802 shutdown_server (context, link->data);
804 link = _dbus_list_get_next_link (&context->servers, link);
809 bus_context_ref (BusContext *context)
811 _dbus_assert (context->refcount > 0);
812 context->refcount += 1;
818 bus_context_unref (BusContext *context)
820 _dbus_assert (context->refcount > 0);
821 context->refcount -= 1;
823 if (context->refcount == 0)
827 _dbus_verbose ("Finalizing bus context %p\n", context);
829 bus_context_shutdown (context);
831 if (context->connections)
833 bus_connections_unref (context->connections);
834 context->connections = NULL;
837 if (context->registry)
839 bus_registry_unref (context->registry);
840 context->registry = NULL;
843 if (context->activation)
845 bus_activation_unref (context->activation);
846 context->activation = NULL;
849 link = _dbus_list_get_first_link (&context->servers);
852 dbus_server_unref (link->data);
854 link = _dbus_list_get_next_link (&context->servers, link);
856 _dbus_list_clear (&context->servers);
860 bus_policy_unref (context->policy);
861 context->policy = NULL;
866 _dbus_loop_unref (context->loop);
867 context->loop = NULL;
870 if (context->matchmaker)
872 bus_matchmaker_unref (context->matchmaker);
873 context->matchmaker = NULL;
876 dbus_free (context->config_file);
877 dbus_free (context->type);
878 dbus_free (context->address);
879 dbus_free (context->user);
881 if (context->pidfile)
884 _dbus_string_init_const (&u, context->pidfile);
886 /* Deliberately ignore errors here, since there's not much
887 * we can do about it, and we're exiting anyways.
889 _dbus_delete_file (&u, NULL);
891 dbus_free (context->pidfile);
894 if (context->user_database != NULL)
895 _dbus_user_database_unref (context->user_database);
899 dbus_server_free_data_slot (&server_data_slot);
903 /* type may be NULL */
905 bus_context_get_type (BusContext *context)
907 return context->type;
911 bus_context_get_address (BusContext *context)
913 return context->address;
917 bus_context_get_registry (BusContext *context)
919 return context->registry;
923 bus_context_get_connections (BusContext *context)
925 return context->connections;
929 bus_context_get_activation (BusContext *context)
931 return context->activation;
935 bus_context_get_matchmaker (BusContext *context)
937 return context->matchmaker;
941 bus_context_get_loop (BusContext *context)
943 return context->loop;
947 bus_context_get_user_database (BusContext *context)
949 return context->user_database;
953 bus_context_allow_user (BusContext *context,
956 return bus_policy_allow_user (context->policy,
957 context->user_database,
962 bus_context_create_client_policy (BusContext *context,
963 DBusConnection *connection,
966 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
967 return bus_policy_create_client_policy (context->policy, connection,
972 bus_context_get_activation_timeout (BusContext *context)
975 return context->limits.activation_timeout;
979 bus_context_get_auth_timeout (BusContext *context)
981 return context->limits.auth_timeout;
985 bus_context_get_max_completed_connections (BusContext *context)
987 return context->limits.max_completed_connections;
991 bus_context_get_max_incomplete_connections (BusContext *context)
993 return context->limits.max_incomplete_connections;
997 bus_context_get_max_connections_per_user (BusContext *context)
999 return context->limits.max_connections_per_user;
1003 bus_context_get_max_pending_activations (BusContext *context)
1005 return context->limits.max_pending_activations;
1009 bus_context_get_max_services_per_connection (BusContext *context)
1011 return context->limits.max_services_per_connection;
1015 bus_context_get_max_match_rules_per_connection (BusContext *context)
1017 return context->limits.max_match_rules_per_connection;
1021 bus_context_get_max_replies_per_connection (BusContext *context)
1023 return context->limits.max_replies_per_connection;
1027 bus_context_get_reply_timeout (BusContext *context)
1029 return context->limits.reply_timeout;
1033 * addressed_recipient is the recipient specified in the message.
1035 * proposed_recipient is the recipient we're considering sending
1036 * to right this second, and may be an eavesdropper.
1038 * sender is the sender of the message.
1040 * NULL for proposed_recipient or sender definitely means the bus driver.
1042 * NULL for addressed_recipient may mean the bus driver, or may mean
1043 * no destination was specified in the message (e.g. a signal).
1046 bus_context_check_security_policy (BusContext *context,
1047 BusTransaction *transaction,
1048 DBusConnection *sender,
1049 DBusConnection *addressed_recipient,
1050 DBusConnection *proposed_recipient,
1051 DBusMessage *message,
1054 BusClientPolicy *sender_policy;
1055 BusClientPolicy *recipient_policy;
1057 dbus_bool_t requested_reply;
1059 type = dbus_message_get_type (message);
1061 /* dispatch.c was supposed to ensure these invariants */
1062 _dbus_assert (dbus_message_get_destination (message) != NULL ||
1063 type == DBUS_MESSAGE_TYPE_SIGNAL ||
1064 (sender == NULL && !bus_connection_is_active (proposed_recipient)));
1065 _dbus_assert (type == DBUS_MESSAGE_TYPE_SIGNAL ||
1066 addressed_recipient != NULL ||
1067 strcmp (dbus_message_get_destination (message), DBUS_SERVICE_ORG_FREEDESKTOP_DBUS) == 0);
1071 case DBUS_MESSAGE_TYPE_METHOD_CALL:
1072 case DBUS_MESSAGE_TYPE_SIGNAL:
1073 case DBUS_MESSAGE_TYPE_METHOD_RETURN:
1074 case DBUS_MESSAGE_TYPE_ERROR:
1078 _dbus_verbose ("security check disallowing message of unknown type %d\n",
1081 dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
1082 "Message bus will not accept messages of unknown type\n");
1087 requested_reply = FALSE;
1091 if (bus_connection_is_active (sender))
1093 sender_policy = bus_connection_get_policy (sender);
1094 _dbus_assert (sender_policy != NULL);
1096 /* Fill in requested_reply variable with TRUE if this is a
1097 * reply and the reply was pending.
1099 if (dbus_message_get_reply_serial (message) != 0)
1101 if (proposed_recipient != NULL /* not to the bus driver */ &&
1102 addressed_recipient == proposed_recipient /* not eavesdropping */)
1106 dbus_error_init (&error2);
1107 requested_reply = bus_connections_check_reply (bus_connection_get_connections (sender),
1109 sender, addressed_recipient, message,
1111 if (dbus_error_is_set (&error2))
1113 dbus_move_error (&error2, error);
1121 /* Policy for inactive connections is that they can only send
1122 * the hello message to the bus driver
1124 if (proposed_recipient == NULL &&
1125 dbus_message_is_method_call (message,
1126 DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS,
1129 _dbus_verbose ("security check allowing %s message\n",
1135 _dbus_verbose ("security check disallowing non-%s message\n",
1138 dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
1139 "Client tried to send a message other than %s without being registered",
1148 sender_policy = NULL;
1150 /* If the sender is the bus driver, we assume any reply was a
1151 * requested reply as bus driver won't send bogus ones
1153 if (addressed_recipient == proposed_recipient /* not eavesdropping */ &&
1154 dbus_message_get_reply_serial (message) != 0)
1155 requested_reply = TRUE;
1158 _dbus_assert ((sender != NULL && sender_policy != NULL) ||
1159 (sender == NULL && sender_policy == NULL));
1161 if (proposed_recipient != NULL)
1163 /* only the bus driver can send to an inactive recipient (as it
1164 * owns no services, so other apps can't address it). Inactive
1165 * recipients can receive any message.
1167 if (bus_connection_is_active (proposed_recipient))
1169 recipient_policy = bus_connection_get_policy (proposed_recipient);
1170 _dbus_assert (recipient_policy != NULL);
1172 else if (sender == NULL)
1174 _dbus_verbose ("security check using NULL recipient policy for message from bus\n");
1175 recipient_policy = NULL;
1179 _dbus_assert_not_reached ("a message was somehow sent to an inactive recipient from a source other than the message bus\n");
1180 recipient_policy = NULL;
1184 recipient_policy = NULL;
1186 _dbus_assert ((proposed_recipient != NULL && recipient_policy != NULL) ||
1187 (proposed_recipient != NULL && sender == NULL && recipient_policy == NULL) ||
1188 (proposed_recipient == NULL && recipient_policy == NULL));
1190 if (sender_policy &&
1191 !bus_client_policy_check_can_send (sender_policy,
1197 const char *dest = dbus_message_get_destination (message);
1198 dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
1199 "A security policy in place prevents this sender "
1200 "from sending this message to this recipient, "
1201 "see message bus configuration file (rejected message "
1202 "had interface \"%s\" member \"%s\" error name \"%s\" destination \"%s\")",
1203 dbus_message_get_interface (message) ?
1204 dbus_message_get_interface (message) : "(unset)",
1205 dbus_message_get_member (message) ?
1206 dbus_message_get_member (message) : "(unset)",
1207 dbus_message_get_error_name (message) ?
1208 dbus_message_get_error_name (message) : "(unset)",
1209 dest ? dest : DBUS_SERVICE_ORG_FREEDESKTOP_DBUS);
1210 _dbus_verbose ("security policy disallowing message due to sender policy\n");
1214 if (recipient_policy &&
1215 !bus_client_policy_check_can_receive (recipient_policy,
1219 addressed_recipient, proposed_recipient,
1222 const char *dest = dbus_message_get_destination (message);
1223 dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
1224 "A security policy in place prevents this recipient "
1225 "from receiving this message from this sender, "
1226 "see message bus configuration file (rejected message "
1227 "had interface \"%s\" member \"%s\" error name \"%s\" destination \"%s\" reply serial %u requested_reply=%d)",
1228 dbus_message_get_interface (message) ?
1229 dbus_message_get_interface (message) : "(unset)",
1230 dbus_message_get_member (message) ?
1231 dbus_message_get_member (message) : "(unset)",
1232 dbus_message_get_error_name (message) ?
1233 dbus_message_get_error_name (message) : "(unset)",
1234 dest ? dest : DBUS_SERVICE_ORG_FREEDESKTOP_DBUS,
1235 dbus_message_get_reply_serial (message),
1237 _dbus_verbose ("security policy disallowing message due to recipient policy\n");
1241 /* See if limits on size have been exceeded */
1242 if (proposed_recipient &&
1243 dbus_connection_get_outgoing_size (proposed_recipient) >
1244 context->limits.max_outgoing_bytes)
1246 const char *dest = dbus_message_get_destination (message);
1247 dbus_set_error (error, DBUS_ERROR_LIMITS_EXCEEDED,
1248 "The destination service \"%s\" has a full message queue",
1249 dest ? dest : (proposed_recipient ?
1250 bus_connection_get_name (proposed_recipient) :
1251 DBUS_SERVICE_ORG_FREEDESKTOP_DBUS));
1252 _dbus_verbose ("security policy disallowing message due to full message queue\n");
1256 if (type == DBUS_MESSAGE_TYPE_METHOD_CALL)
1258 /* Record that we will allow a reply here in the future (don't
1259 * bother if the recipient is the bus). Only the addressed recipient
1262 if (sender && addressed_recipient &&
1263 !bus_connections_expect_reply (bus_connection_get_connections (sender),
1265 sender, addressed_recipient,
1268 _dbus_verbose ("Failed to record reply expectation or problem with the message expecting a reply\n");
1273 _dbus_verbose ("security policy allowing message\n");